Use __dict__.update to update an object's fields.

This commit is contained in:
Bob Lantz
2010-09-01 19:51:09 -07:00
parent eaf5888ae0
commit 73a098a499
+1 -2
View File
@@ -448,8 +448,7 @@ class ConsoleApp( Frame ):
def assign( obj, **kwargs ):
"Set a bunch of fields in an object."
for name, value in kwargs.items():
setattr( obj, name, value )
obj.__dict__.update( kwargs )
class Object( object ):
"Generic object you can stuff junk into."