Paul Moore wrote:
now that Python has type
inference, it should be possible for users to just type {} and have
the interpreter work out which was intended from context.

Or have {} return an ambiguous object that turns into a dict or
set depending on what is done to it.

We could call it a quict (quantum dict).

To support this, we would also have to add a third possible
value for type bool:

>>> x = {}
>>> isinstance(x, dict)
Maybe
>>> isinstance(x, set)
Maybe
>>> x['foo'] = 42
>>> isinstance(x, dict)
True
>>> isinstance(x, set)
False

--
Greg
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to