15 Jul
2005
15 Jul
'05
4:44 p.m.
Peter Bengtsson wrote:
Just one python question Chris, why do you do this:: class User(BasicUser): def __init__(self,dict): d['__'] = dict['password']
What's wrong just doing self.__ = dict['password']
I'm not looking at the code as I write this, so I may be wrong, but I do that because, if you look further down, you'll see I define a __setattr__ hook that raises an exception, since seeing attributes on object of this type is a really bad thing to do, so you have to go through lots of hoops if you really want to do it ;-) cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk