[Fwd: ANN: Pyrex 0.9.6]

Alexander Belchenko bialix at ukr.net
Mon Oct 8 19:39:23 BST 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Alexander Belchenko пишет:
> Pyrex 0.9.6 is now available:
> 
>    http://www.cosc.canterbury.ac.nz/~greg/python/Pyrex/
> 
> There is a *lot* of new stuff in this version, too much
> to fit into this announcement. Read all about it here:
> 
>    http://www.cosc.canterbury.ac.nz/greg.ewing/python/Pyrex/changes-0.9.6.html

I want to note about future backward incompatible changes
planning for 0.9.7+ versions of Pyrex:

- --------------------------------------------------------------------------
Language Changes
Renaming __new__ to __cinit__
In a future version of Pyrex, I would like to make it possible to give an extension type a __new__
method that works more like the standard Python __new__. As a first step towards that, I am renaming
Pyrex's current __new__ method to __cinit__. The migration plan is as follows:

   1. In Pyrex 0.9.6, a warning is given whenever you define a __new__ method for an extension type,
and it is automatically renamed to __cinit__ for you. This will allow existing Pyrex code towork
unchanged for the time being.
   2. In Pyrex 0.9.7, the warning will become an error, and no renaming will be performed. You will
have to update your source to use __cinit__ instead of __new__.
   3. In some later version, a __new__ method will be re-introduced with different semantics.

If you still have code around which uses __new__ in the old way by the time step 3 arrives, it will
either fail to work or work incorrectly. It is recommended that you begin updating your Pyrex source
now to use __cinit__ instead of __new__.
- ---------------------------------------------------------------------------

Currently our pyrex extensions are used __new__, and compiling with Pyrex 0.9.6.1
gives me expected warnings:

C:\work\Bazaar\mydev\bzr.dev\bzrlib/_dirstate_helpers_c.pyx:481:4: Warning: __new__ method of
extension type will change semantics in a future version of Pyrex. Use __cinit__ instead.

C:\work\Bazaar\mydev\bzr.dev\bzrlib/_knit_load_data_c.pyx:89:4: Warning: __new__ method of extension
type will change semantics in a future version of Pyrex. Use __cinit__ instead.


It seems that Bazaar should either sticks with Pyrex <= 0.9.6.x or implement some workaround for
this situation.

- --
[µ]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHCnlbzYr338mxwCURAqKIAJ44bplskguVQbhnYpumICT/OsmOlwCgim9c
TNSXNjqOFBxrlRWTaDFDGks=
=c+rk
-----END PGP SIGNATURE-----



More information about the bazaar mailing list