The definition of an object in Python
maxm at mxm.dk
Sun Jul 13 19:51:35 CEST 2003
Avi Kak wrote:
> But when I do the following
> mystring = 'hello'
> print mystring.id()
> print mystring.type()
> Python complains that mystring does not possess the attributes
> id and type.
mystring = 'hello'
>>> <type 'string'>
id and type are built in functions. Not methods on objects.
Wich imho is a good thing. This means that you can have methods on
objects called id and type, without loosing the ablity to use these
regards Max N
More information about the Python-list