K
Kent Johnson
In the Python tutorial section 9.1, it says, "the word ``object'' in
Python does not necessarily mean a class instance. Like C++ and
Modula-3, and unlike Smalltalk, not all types in Python are classes: the
basic built-in types like integers and lists are not, and even somewhat
more exotic types like files aren't."
Is this still correct or was it made obsolete by Python 2.2? Lists and
files have __class__ attributes, at least:
So do integers and floats, though you have to ask nicely for an int: File "<stdin>", line 1
1.__class__
^
SyntaxError: invalid syntax<type 'float'>
Kent
Python does not necessarily mean a class instance. Like C++ and
Modula-3, and unlike Smalltalk, not all types in Python are classes: the
basic built-in types like integers and lists are not, and even somewhat
more exotic types like files aren't."
Is this still correct or was it made obsolete by Python 2.2? Lists and
files have __class__ attributes, at least:
<type 'file'>>>> [].__class__>>> f = open('ThreadQueue.py')
>>> f.__class__
So do integers and floats, though you have to ask nicely for an int: File "<stdin>", line 1
1.__class__
^
SyntaxError: invalid syntax<type 'float'>
Kent