[Numpy-discussion] datetime uses API deprecated in python3.1
Charles R Harris
Mon Feb 22 14:53:56 CST 2010
On Mon, Feb 22, 2010 at 1:45 PM, Pauli Virtanen <email@example.com> wrote:
> ma, 2010-02-22 kello 13:25 -0700, Charles R Harris kirjoitti:
> > It looks like context is the new name for desc, so
> > that PyCObject_FromVoidPtrAndDesc can be implemented
> > as two calls.
> > I think it is a bit tricky to implement these as
> > macros, getting the return back from a multi call
> > substitution can be doable with a comma expression,
> > but I think a better route is to define our own
> > library of compatible functions, prepending npy_ to
> > the current PyCObject functions.
> I think we can just put static functions into npy_3kcompat.h. They're
> anyway going to be short.
> [clip: destructors]
> > So, I think it isn't a big problem to do this with #ifdef's in the
> > code. That is the way I'm going unless you object.
> No objection here. I don't see any other way to deal with the destructor
I'm actually using #ifdefs for the whole change, no macros in the include
files. It hasn't been a lot of work so far. The c_api is currently exported
as a PyCObject, we might want to give it a name when it is a PyCapsule. The
include file will need some #ifdefs too.
> > I'm not sure if using PyCapsule objects will make pickled arrays
> > incompatible between py2k and py3k, but so it goes.
> The pickled arrays are, IIRC, only backward compatible, so that Py2
> pickles can be opened with Py3, but not vice versa. This is because of
> the str versus unicode issue.
Backward compatibility will probably break with PyCapsules in the array
instead of PyCObjects.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the NumPy-Discussion