At Friday 29/12/2006 13:17, Steven D'Aprano wrote:

>>> X.__dict__
{'__module__': '__main__', '__doc__': None}
>>> X.__name__
'X'
>>> X.__bases__
()

Now that's interesting... if __name__ and __bases__ don't live in the
class __dict__, where do they live? What other methods and attributes are
invisibly in X?

They live in the C structure implementing the type; members tp_bases and tp_name respectively. Most predefined type/class attributes have an slot for storing its value, for efficiency. See include/object.h


--
Gabriel Genellina
Softlab SRL

        

        
                
__________________________________________________ Preguntá. Respondé. Descubrí. Todo lo que querías saber, y lo que ni imaginabas, está en Yahoo! Respuestas (Beta). ¡Probalo ya! http://www.yahoo.com.ar/respuestas
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to