Message224578
| Author | serhiy.storchaka |
|---|---|
| Recipients | barry, ethan.furman, mark, serhiy.storchaka |
| Date | 2014-08-02.18:39:02 |
| SpamBayes Score | -1.0 |
| Marked as misclassified | Yes |
| Message-id | <1407004742.88.0.854945663648.issue22123@psf.upfronthosting.co.za> |
| In-reply-to |
| Content | |
|---|---|
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 |
|
| History | |||
|---|---|---|---|
| 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 | |