Re: [Python-Dev] What if replacing items in a dictionary returns the new dictionary?

2011-05-05 Thread Giuseppe Ottaviano
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

Re: [Python-Dev] What if replacing items in a dictionary returns the new dictionary?

2011-05-05 Thread Roy Hyunjin Han
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 ==

[Python-Dev] What if replacing items in a dictionary returns the new dictionary?

2011-04-29 Thread Roy Hyunjin Han
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

Re: [Python-Dev] What if replacing items in a dictionary returns the new dictionary?

2011-04-29 Thread Mark Shannon
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

Re: [Python-Dev] What if replacing items in a dictionary returns the new dictionary?

2011-04-29 Thread R. David Murray
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

Re: [Python-Dev] What if replacing items in a dictionary returns the new dictionary?

2011-04-29 Thread Oleg Broytman
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? ::

Re: [Python-Dev] What if replacing items in a dictionary returns the new dictionary?

2011-04-29 Thread Roy Hyunjin Han
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.  

Re: [Python-Dev] What if replacing items in a dictionary returns the new dictionary?

2011-04-29 Thread Roy Hyunjin Han
  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