Re: [Tutor] object structure

2010-05-12 Thread Eike Welk
Hello Denis! On Wednesday May 12 2010 14:37:54 spir ☣ wrote: > class Integer(int): pass > i = Integer(1) > i.name = "one" > print i,i.name# --> "1 one" > > An instance of Integer has both a value 1 and a dict. Actually, one can do > more sophisticated things (below __new__ is needed bec

[Tutor] object structure

2010-05-12 Thread spir ☣
Hello, Python objects are supposed to be mainly a structure composed of a (pointer to a) type and a (pointer to a) value; and to be more or less implemented that way in the C version. When an object is of a standard type like a number, the value field would then point to a C value, or rather