[Cython] [cython-users] Re: Cython alpha 0.24

Ian Henriksen insertinterestingnamehere at gmail.com
Mon Mar 21 22:06:17 EDT 2016


On Mon, Mar 21, 2016 at 6:29 PM Martin Bammer <mrbm74 at gmail.com> wrote:

> Hi,
>
> I just saw that PyrexTypes.py seems to have a typo in lines 3740 and 3742:
>
> def __cmp__(self, other):
>     if isinstance(other, TemplatePlaceholderType):
>         return cmp(self.name, other.name)
>     else:
>         return cmp(type(self), type(other))
>
>
> PyCharm is complaining that "cmp" is an unresolved reference.
>
> Regards,
>
> Martin
>
> AFAICT, that whole function isn't really necessary. It defines the behavior
for when you call `cmp` on an instance of that particular class. In Python
3 that particular builtin function doesn't exist. It'll work fine in Python
2, but
since the codebase supports both it's not clear when that would actually
be useful.
Best,
-Ian Henriksen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/cython-devel/attachments/20160322/3b1f2a3c/attachment.html>


More information about the cython-devel mailing list