[Python-ideas] The "in"-statement

Serhiy Storchaka storchaka at gmail.com
Mon Nov 5 20:49:20 CET 2012


On 05.11.12 21:28, Markus Unterwaditzer wrote:
> I thought it would be neat if i could do::
>
>      in obj:
>          first_attr = "value"
>          second_attr = "value2"

     vars(obj).update(
         first_attr="value",
         second_attr="value2",
         )

Or obj.__dict__.update.




More information about the Python-ideas mailing list