A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2008-January/076107.html below:

[Python-Dev] PySequence_Concat for dicts

[Python-Dev] PySequence_Concat for dicts [Python-Dev] PySequence_Concat for dictsJared Flatow jflatow at northwestern.edu
Sat Jan 12 00:01:10 CET 2008
Hi all,

I am fairly new to the Python community so please forgive me (and  
correct me) if I am going about this wrong.

I think it would be convenient and pythonic if dict objects  
implemented the PySequence_Concat method. I see there was once a  
short-lived discussion about this here:

http://mail.python.org/pipermail/patches/2004-March/014323.html

I have also been following the discussion about contributing to  
Python. It seems to me that this would be a fairly easy feature to  
implement (perhaps naively?), and I would be glad to try writing a  
patch for this if there is at least some chance of it making it into  
one of the branches. Can someone please advise me on what the correct  
order for going about this would be? Do I need to first write a PEP  
justifying why I think it would be an improvement? Which version of  
Python (if any), should a patch be targeted at?

Otherwise, is there a good reason dicts do not already implement this  
method? I somewhat understand the complaint about commutativity, but  
as mentioned in the previous discussion, list concatenation is not  
commutative either. Seeing as update is the only builtin method for  
concatenation of dicts in the first place, it doesn't seem all that  
confusing that 'summing' two dicts should conveniently return a new  
instance that is the (only form of) concatenation of the two dicts.

regards,
jared
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4