[Cython] tp_alloc() vs. object.__new__() (was: Cython 0.20 beta 2)

Stefan Behnel stefan_ml at behnel.de
Sun Jan 12 10:21:16 CET 2014


Stefan Behnel, 12.01.2014 09:20:
> The only thing that is still a bit unclear to me is whether calling
> object.__new__() from extension types was a good idea:
> 
> https://github.com/cython/cython/commit/ddaffbe78c06e580ca0d9cd334c7a28a4de5c40b
> 
> It means that we are now running a couple of safety checks inside of
> CPython on object instantiation that validate the arguments being passed
> into __init__() and __new__(), because object() doesn't expect any.
> 
> http://thread.gmane.org/gmane.comp.python.cython.user/10267/focus=10519
> 
> If we want to play safe for the release, we could restrict this change only
> to abstract classes for now (for which we know that CPython will generate
> an error). That was the original intention of the change anyway.

Proposed patch push to master for testing.

https://github.com/cython/cython/commit/1a56a04bfe1b8460ecf3886c3de9268cb5e0c93a

Stefan



More information about the cython-devel mailing list