On Wed, Apr 7, 2021 at 10:30 PM Stestagg <stest...@gmail.com> wrote: > > > > On Wed, Apr 7, 2021 at 12:31 PM Chris Angelico <ros...@gmail.com> wrote: >> >> >> I just realised that the whole eval/exec/namespace stuff is massive >> overkill. All you need is an object that is inconsistent in its >> boolification... >> > > Somewhat related: https://bugs.python.org/issue42899 >
Yup. There are a very few edge cases where pathological behaviour can be optimized out. Sometimes, there's an alternative way to describe it (for example, containment is defined as "identity or equality"), but other times, you can't actually pin down the exact semantics in Python code. Or maybe it's possible, but really hard; the precise meaning of "yield from iterable" is quite the read - check out PEP 380, and notice that even just calling a method isn't as simple as it looks :) ChrisA -- https://mail.python.org/mailman/listinfo/python-list