__dict__ is neato torpedo!
Tim Chase
python.list at tim.thechases.com
Sun Jun 12 06:57:40 EDT 2011
More information about the Python-list mailing list
Sun Jun 12 06:57:40 EDT 2011
- Previous message (by thread): __dict__ is neato torpedo!
- Next message (by thread): which threading libraries to use?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 06/11/2011 08:32 PM, Andrew Berg wrote: > I'm pretty happy that I can copy variables and their value from one > object's namespace to another object's namespace with the same variable > names automatically: > > b.__dict__.update(a.__dict__) > > The reason I'm posting this is to ask what to watch out for when doing > this. I've seen vague warnings that I don't really understand, and I'm > hoping someone can enlighten me. I guess the summary is is "it does *exactly* what an Python experienced programmer would expect it to, so if things break you get to keep both pieces" (which even nicely summarizes Steven's sub-thread about objects lacking __dict__). Based on your reactions to the replies, I'd say you're sufficiently experienced in Python to have your expectations align with Python reality. -tkc
- Previous message (by thread): __dict__ is neato torpedo!
- Next message (by thread): which threading libraries to use?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list