On Fri, Apr 29, 2011 at 4:05 PM, Roy Hyunjin Han
starsareblueandfara...@gmail.com wrote:
You can implement this in your own subclass of dict, no?
Yes, I just thought it would be convenient to have in the language
itself, but the responses to my post seem to indicate that [not
returning the
2011/4/29 Roy Hyunjin Han starsareblueandfara...@gmail.com:
It would be convenient if replacing items in a dictionary returns the
new dictionary, in a manner analogous to str.replace(). What do you
think?
# Current behavior
x = {'key1': 1}
x.update(key1=3) == None
x ==
It would be convenient if replacing items in a dictionary returns the
new dictionary, in a manner analogous to str.replace(). What do you
think?
::
# Current behavior
x = {'key1': 1}
x.update(key1=3) == None
x == {'key1': 3} # Original variable has changed
# Possible
Roy Hyunjin Han wrote:
It would be convenient if replacing items in a dictionary returns the
new dictionary, in a manner analogous to str.replace(). What do you
think?
::
# Current behavior
x = {'key1': 1}
x.update(key1=3) == None
x == {'key1': 3} # Original variable has
On Fri, 29 Apr 2011 10:27:46 -0400, Roy Hyunjin Han
starsareblueandfara...@gmail.com wrote:
It would be convenient if replacing items in a dictionary returns the
new dictionary, in a manner analogous to str.replace(). What do you
think?
This belongs on python-ideas, but the short answer is
Hi! Seems like a question for python-ideas mailing list, not for python-dev.
On Fri, Apr 29, 2011 at 10:27:46AM -0400, Roy Hyunjin Han wrote:
It would be convenient if replacing items in a dictionary returns the
new dictionary, in a manner analogous to str.replace(). What do you
think?
::
2011/4/29 R. David Murray rdmur...@bitdance.com:
2011/4/29 Roy Hyunjin Han starsareblueandfara...@gmail.com:
It would be convenient if replacing items in a dictionary returns the
new dictionary, in a manner analogous to str.replace()
This belongs on python-ideas, but the short answer is no.
You can implement this in your own subclass of dict, no?
Yes, I just thought it would be convenient to have in the language
itself, but the responses to my post seem to indicate that [not
returning the updated object] is an intended language feature for
mutable types like dict or list.
class