2 ms·
Isn't it one of the core Python values that functions don't contract to accept, or return, particular types at all?
by thaumasiotes 14y ago
Isn't it one of the core Python values that functions don't contract to accept, or return, particular types at all?
- ansgri 14y agoThere's no enforced contract for a particular type, but a way to create entirely new values that have no relation to any existing value. I.e. you compare a value to MyEnum.SpecialUndefined and are sure that no None or 0 will yield True. OTOH, if someone would be determined to create a thing with the same conceptual sense as SpecialUndefined, he could explicitly define that it is Equal to MyEnum.SpecialUndefined.