None < 0 ???

Rafael Villar Burke pachi en rvburke.com
Jue Ene 3 02:48:26 CET 2008


Chema Cortes wrote:
> Es curioso que None tenga su contraparte en el singleton
> 'NotImplemented', actuando de forma contraria a None (o sea,
> NotImplemented siempre es mayor que cualquier número). ¿Existe algún
> motivo para estos comportamientos?
Mirando el código, por curiosidad, veo esto sobre Py_None:

//*
_Py_NoneStruct is an object of undefined type which can be used in contexts
where NULL (nil) is not suitable (since NULL often means 'error').

Don't forget to apply Py_INCREF() when returning this value!!!
*//
*PyAPI_DATA*(PyObject) _Py_NoneStruct; //* Don't use this directly *//
#*define* Py_None (&_Py_NoneStruct)


Así que, tal vez, NotImplemented use NULL para señalar un error y PyNone
su opuesto.

Saludos,

Rafael Villar Burke
_______________________________________________
Lista de correo Python-es 
http://listas.aditel.org/listinfo/python-es
FAQ: http://listas.aditel.org/faqpyes





Más información sobre la lista de distribución Python-es