
July 27, 2022
4:36 a.m.
On Wed, 27 Jul 2022 at 21:13, Mathew Elman <mathew.elman@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