__setattr__???

Wenn du dir nicht sicher bist, in welchem der anderen Foren du die Frage stellen sollst, dann bist du hier im Forum für allgemeine Fragen sicher richtig.
Antworten
john
User
Beiträge: 3
Registriert: Sonntag 19. Juni 2005, 19:14

Sonntag 19. Juni 2005, 19:38

hi all,

i have overwritten the __setattr__() function in my class, but the code inside this function is called whenever an instance of my class is created. does it really work like this??

the problem is i want __setattr__ be called only when an attribute assignment is attempted.

any one can help me? thanks a lot in advance!

john
mawe
Python-Forum Veteran
Beiträge: 1209
Registriert: Montag 29. September 2003, 17:18
Wohnort: Purkersdorf (bei Wien [Austria])

Sonntag 19. Juni 2005, 19:48

Hi!

Could you please show us your code (at least some relevant parts). Without this it's hard to help you ;)

Regards, mawe
Antworten