Message224578
This will be fragile because the behavior will be depend from the number of keyword argument. Hypothetic example:
>>> kwargs = {'a': 1}
>>> obj = object(**kwargs)
>>> obj.b = 2 # success
>>> kwargs = {} # empty
>>> obj = object(**kwargs)
>>> obj.b = 2
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'object' object has no attribute 'b'
For now you need only one or two line of code to declare new class.
>>> class Object: pass
...
>>> obj = Object()
>>> obj.a = 1
>>> obj.b = 2 |
|
Date |
User |
Action |
Args |
2014-08-02 18:39:03 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, barry, mark, ethan.furman |
2014-08-02 18:39:02 | serhiy.storchaka | set | messageid: <1407004742.88.0.854945663648.issue22123@psf.upfronthosting.co.za> |
2014-08-02 18:39:02 | serhiy.storchaka | link | issue22123 messages |
2014-08-02 18:39:02 | serhiy.storchaka | create | |
|