Class Chaos

Tristan Seligmann mithrandi at
Mon Jun 28 19:59:22 CEST 2004

On Mon, Jun 28, 2004 at 12:45:37 -0400, Leif K-Brooks wrote:
> Paul McGuire wrote:
> >You will also find that you avoid some funny Python behavior if you
> >avoid
> >using built-in type names (such as list, dict, and str) for variable
> >names.
> What sort of funny behavior?

Code that uses the names without expecting them to be masked by other

str = "Blah blah"
... later ...

Produces the slightly mysterious:
    TypeError: 'str' object is not callable

Correct behavior, to be sure, but potentially confusing.
mithrandi, i Ainil en-Balandor, a faer Ambar
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 196 bytes
Desc: Digital signature
URL: <>

More information about the Python-list mailing list