newbie: class and __dict__ variable.

2010-09-19 Thread mafeusek
Hallo Group Members. From time to time I see in python code following notation that (as I believe) extends namespace of MyClass. class MyClass: def __init__(self): self.__dict__["maci"]=45 myCl2 = MyClass2() print myCl2.maci I am guessing that there must be some difference between t

Re: newbie: class and __dict__ variable.

2010-09-20 Thread mafeusek
Terry, thank You very much for Your answer. Very helpfull! > Have you seen exactly this usage? NO, i just wrote an example, but the trick is quite frequent, thus it will be easy to check out the existence of .__setattr__ in such a case. best regards, Pawel -- http://mail.python.org/mailman/list

del() function - cannot find documentation

2010-10-07 Thread mafeusek
Hallo ML. there is following python script: mine = { 1: "sd", 2: "mk" } del(mine[1]) print mine the problem is I cannot find any information about del() function in python 2.7 documentation. is it a documentation bug or I misunderstand something about del()? best regards, Pawel -- http://mai