class.print method illegal

Larry Bates lbates at swamisoft.com
Fri Jun 11 20:17:03 CEST 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