[Python-ideas] Sets, Dictionaries

Clint Hepner clint.hepner at gmail.com
Thu Mar 29 12:04:15 EDT 2018


> On 2018 Mar 29 , at 11:42 a, Julia Kim <julia.hiyeon.kim at gmail.com> wrote:
> 
> My suggestion is to change the syntax for creating an empty set and an empty dictionary as following.
> 
> an_empty_set = {}
> an_empty_dictionary = {:}

If you are willing to accept {:} as an empty dict, then surely {,} would suffice as an empty set, with no backwards compatibility issues at all.

Also, this is also not a new idea (https://mail.python.org/pipermail/python-3000/2006-April/001286.html). I don't know
if this was never seriously considered further, or if it was formally rejected.

> 
> Compatibility issues could be resolved with a program which takes a Python program (codes) as a text and edits it.

It's not that simple. This would require changing the vast majority of Python scripts ever written, including code which has never and will never care about `set` objects. Depending on the setting would require version-control check-ins and probably code review. Is cleaning up a minor divergence from mathematical notation really worth that kind of churn?

--
Clint


More information about the Python-ideas mailing list