class.print method illegal

Larry Bates lbates at swamisoft.com
Fri Jun 11 14:17:03 EDT 2004


I just ran into something I've not seen before:

class foo:
    def print(self):
        ...do something...

creates a syntax error.  Why can't a class have
a method called "print"?  Doesn't seem to be
any way it could be confused with the reserved
print statement, or am I missing something?

Regards,
Larry Bates






More information about the Python-list mailing list