On Wed, 27 Jul 2022 at 21:13, Mathew Elman <mathew.el...@ocado.com> wrote:
>
> To answer how this _could_ work, Undefined would be a new NoneType that is 
> falsey (just like None) can't be reassigned (just like None) and does 
> everything else just like None _except_ that when it is passed as a function 
> argument, the argument name is bound to the default if it has one instead.
>

Okay. Everything else just like None. So I can do this?

a = Undefined
b = {1: Undefined}
c = {Undefined: 2}
print(b[1])
a in c # s/be True
c[a] # s/be 2

What would these do? And especially, what would happen if, instead of
vanilla dictionaries, b and c were custom classes?

ChrisA
_______________________________________________
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/CHUNJBJXUX3HRP77RZFZ3GDECKK2KOHZ/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to