ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> python-dev
python-dev
Re: [Python-Dev] New PEP: Using ssize_t as the index type
by "Martin v. Löwis" other posts by this author
Jan 10 2006 12:29PM messages near this date
Re: [Python-Dev] New PEP: Using ssize_t as the index type | Re: [Python-Dev] New PEP: Using ssize_t as the index type
M.-A. Lemburg wrote:
>  I don't see a good solution for these other than introducing
>  a set of new APIs (and maybe doing some macro magic as Martin
>  did for PyArg_ParseTuple()). Due to the fact that changes in
>  the types of output parameters require changes in the
>  extension variable type layout itself, they introduce a large
>  number of type changes in the extension and make writing
>  backwards compatible extensions harder than necessary.

That's not true. It is very easy to write extensions that
receive such values and are still backwards-compatible.

Suppose you had

  int pos;
  PyObject *k, *v;

  PyDict_Next(dict, &pos, &k, &v);

You just change this to

  /* beginning of file */
  #ifdef Py_HEX_VERSION < 2.5
  typedef int Py_ssize_t;
  #endif

  /* later */
  Py_ssize_t pos;
  PyObject *k, *v;

  PyDict_Next(dict, &pos, &k, &v);

That's it!

>  Furthermore, all extensions for Python 2.4 would have to be
>  ported to the new Python API and porting is not going to
>  be a simple recompile, but will require C skills.

Not all extensions. Only those that call functions that expect
int* output parameters - which is fairly uncommon.

>  Martin, please add the above points to the PEP. I'd also
>  like to see it published, because it's hard to track a PEP
>  in the mailing

It's very difficult to get a PEP number assigned. I wrote
peps@[...].org with no response.

Regards,
Martin
_______________________________________________
Python-Dev mailing list
Python-Dev@[...].org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/python-dev-ml%40activestate.c
om
Thread:
"Martin v. Löwis"
Travis E. Oliphant
"Martin v. Löwis"
Brett Cannon
Fredrik Lundh
"Martin v. Löwis"
Tim Peters
"Martin v. Löwis"
Armin Rigo
"Martin v. Löwis"
Armin Rigo
"Martin v. Löwis"
M.-A. Lemburg
Neal Norwitz
"Martin v. Löwis"
M.-A. Lemburg
"Martin v. Löwis"
M.-A. Lemburg
"Martin v. Löwis"
M.-A. Lemburg
"Martin v. Löwis"
Tim Peters
"Martin v. Löwis"
Michael Urman
Neal Norwitz
Aahz
"Martin v. Löwis"
Guido van Rossum

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved