My stupid newbie mistake

Larry Bates lbates at syscononline.com
Mon Apr 11 10:51:47 EDT 2005


Because Python allows you to replace built-in methods with
your own.  Later you will find that this can be extremely
powerful.  You will stumble on this if you name a list 'list'
a string 'str', integer 'int', float 'float', dictionary
'dict', ... (at least I did <grin>).

-Larry Bates

Matt Feinstein wrote:
> I named a file 'try.py' and then was stumped, for a while, when
> 
> 
>>>>import try
> 
> 
> gave a syntax error... So, how about a
> 'YouAreUsingAReservedWordStupid' exception ?
> 
> Matt Feinstein
> 
> --
> There is no virtue in believing something that can be proved to be true.



More information about the Python-list mailing list