[Cython] Possible bug (or wrong documentation) WRT "not None"

Samuele Kaplun Samuele.Kaplun at cern.ch
Thu Dec 4 09:30:55 CET 2014


Dear Stefan,

In data mercoledì 3 dicembre 2014 16:44:13, Stefan Behnel ha scritto:
> Samuele Kaplun schrieb am 02.12.2014 um 14:13:
> > I would like to report what I think is a possible bug (in cython or
> > corresponding documentation).
> > 
> > According to:
> > <http://docs.cython.org/src/userguide/extension_types.html#extension-types
> > -and-none>
> > 
> > [...]
> > The self parameter of a method of an extension type is guaranteed never to
> > be None.
> > [...]
> > 
> > However given this snippet:
> > [...]
> > 
> > cdef class test:
> >     def __sub__(self, test rhs not None):
> >         print "self is %s" % repr(self), "rhs is %s" % repr(rhs)
> > 
> > [...]
> 
> http://docs.cython.org/src/userguide/special_methods.html#arithmetic-methods

thanks for the pointer. Then I guess the documentation could be improved by 
e.g. saying something similar to:

[...]
The self parameter of a method of an extension type is guaranteed never to be 
None. (Note: arithmetic methods might be an exception to this rule. 
[http://docs.cython.org/src/userguide/special_methods.html#arithmetic-methods]).
[...]

Cheers,
	Samuele
-- 
Samuele Kaplun
Invenio Developer ** <http://invenio-software.org/>



More information about the cython-devel mailing list