[Tutor] Possibly odd question on everything
Gregor Lingl
glingl@aon.at
Thu, 22 Nov 2001 23:59:00 +0100
Dear Pythonistas!
One often says: in Python everything is an object.
In preparing some lecture for my students I met
the following:
>>> type(print)
File "<stdin>", line 1
type(print)
SyntaxError: invalid syntax
(I didn't know, what to expect)
and also:
>>> type(print 3)
File "<stdin>", line 1
type(print 3)
SyntaxError: invalid syntax
(I admit, I expected None)
So there is something, called print-statement,
which doesn't seem to belong to everything
Hmmm?
Aren't there languages, where really everything
is an object (maybe Smalltalk, maybe Ruby ...
and what about the equivalence of code and data
in Scheme...?)
Interesting, but perhaps not very important, especially
for the rather pragmatic Python-community
Gregor
P. S.: I am really glad, that there exist such a wonderful
mailing list like this one, where I dare to put questions
thus obscure - without having to be afraid to get
expelled ...