On 9/20/2010 5:51 AM, Bruno Desthuilliers wrote:
Steven D'Aprano a écrit :
On Mon, 20 Sep 2010 09:27:25 +0200, Bruno Desthuilliers wrote:
If the class has a .__setattr__ method, the first bypasses that method,
It also bypasses object.__setattribute__ and - as a consequence - any
binding descr
Steven D'Aprano a écrit :
On Mon, 20 Sep 2010 09:27:25 +0200, Bruno Desthuilliers wrote:
If the class has a .__setattr__ method, the first bypasses that method,
It also bypasses object.__setattribute__ and - as a consequence - any
binding descriptor by the same name as the attribute being set.
On Mon, 20 Sep 2010 09:27:25 +0200, Bruno Desthuilliers wrote:
>> If the class has a .__setattr__ method, the first bypasses that method,
>
> It also bypasses object.__setattribute__ and - as a consequence - any
> binding descriptor by the same name as the attribute being set.
__setattribute__ ?
Terry Reedy a écrit :
On 9/19/2010 1:37 PM, mafeu...@gmail.com wrote:
Hallo Group Members. From time to time I see in python code following
notation that (as I believe) extends namespace of MyClass.
No, it does not affect MyClass, just the instance dict.
class MyClass:
def __init__(sel
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
On 9/19/2010 1:37 PM, mafeu...@gmail.com wrote:
Hallo Group Members. From time to time I see in python code following
notation that (as I believe) extends namespace of MyClass.
No, it does not affect MyClass, just the instance dict.
class MyClass:
def __init__(self):
self.__dic
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