Class Chaos

Paul McGuire ptmcg at austin.rr._bogus_.com
Mon Jun 28 11:55:20 EDT 2004


"Maximilian Michel" <michel at in.tum.de> wrote in message
news:d0ce39b4.0406280157.166b9d76 at posting.google.com...
> Hallo everyone,
>
> i hope someone can help me with this kind a interesting problem i have
> in python 2.3:
>
> my code looks like this:
>
> class Read:
>      list = []
>      __init__(self):
>               self.list.append = ***data from file***
>      print(self):
>               print self.list
>
<snip>

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.

-- Paul





More information about the Python-list mailing list