[Python-ideas] The "in"-statement
ironfroggy at gmail.com
Tue Nov 6 23:17:43 CET 2012
On Mon, Nov 5, 2012 at 2:28 PM, Markus Unterwaditzer <
markus at unterwaditzer.net> wrote:
> This is my first post on this mailinglist and i haven't lurked a long time
> so please be gentle.
> While mocking objects, i got annoyed by the following code pattern i had to
> use when modifying multiple attributes on a single object::
> obj.first_attr = "value"
> obj.second_attr = "value2"
> some_other = "lel"
> I thought it would be neat if i could do::
> in obj:
> first_attr = "value"
> second_attr = "value2"
> some_other = "lel" # indenting this would cause it to appear as an
> attribute of obj
a = b
Tell me what this does, then.
> Just a vague idea. Tell me what you think.
> -- Markus
> Python-ideas mailing list
> Python-ideas at python.org
Read my blog! I depend on your acceptance of my opinion! I am interesting!
Follow me if you're into that sort of thing:
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-ideas