[Cython] Class scope lookup order

Stefan Behnel stefan_ml at behnel.de
Mon Aug 15 20:17:37 CEST 2011

Vitja Makarov, 15.08.2011 19:56:
> 2011/8/15 Stefan Behnel:
>> Vitja Makarov, 15.08.2011 19:11:
>>> I think I'm done with the issue and if you don't mind I'll push that.
>>> https://github.com/vitek/cython/commit/b4a0493efbae68b30d54f0c58311c71465d57d43
>> Could you please use a .py file for the test instead of a .pyx file? It's
>> worth comparing the result to CPython automatically. Also, please let the
>> test classes inherit from object to make them new style classes in Py2.
>> Apart from that, the implementation looks good.
> Here it is:
> https://github.com/vitek/cython/commit/6701884a37b982f78f9af423857b0c47c2d76867


> CPython NameError is more verbose ''name '%s' is not defined"  so I
> used ellipsis.

Note that you can also use something like

    NameError:... 'B' ...

> What the difference between old-style and new-style classes for this tests?

None. That's why I think we should not use old-style classes.


More information about the cython-devel mailing list