Wes, sorry, but I really don't follow what you're saying. For example, [Wes Turner <wes.tur...@gmail.com>] > Do not do this: > > x = 2 > if (x == 3) or (x := 3): > print(x) > > What do we call that mistake?
It displays 3 - while it appears to be silly code, there's nothing about it that's undefined. So I fail to see how showing that example anywhere would do anyone any good. You can do the same kind of thing today via, e.g., class Bindable: def __init__(self, value): self.bind(value) def bind(self, value): self.value = value return value def __bool__(self): return bool(self.value) def __eq__(self, other): return self.value == other def __str__(self): return str(self.value) Then: >>> x = Bindable(2) >>> if x == 3 or x.bind(3): ... print(x) 3 And I wouldn't put that example anywhere in any docs either ;-) _______________________________________________ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com