Currently, it is not possible to use a single method name to add an item to a 
collection that might be a set or a list.

There have been other requests for a "push" method to be a complement to "pop", 
so if that were added to both set and list (synonym for <set>.add and 
<list>.append) that would solve the issue.

Additionally, there have been other requests for an operator for adding to a 
collection, and in some other languages such as C++ and Ruby, "<<" is used for 
the same or similar purposes. Perhaps both "push" and "__lshift__" could be 
added as synonymous operations.
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/4UJXITCREFUHTV23BP2Z235TGBY743GA/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to