Any chance for reconsideration of PEP 335?

→ True.
(Related :Linked Booleans Logics (rethinking PEP 505))

The only way out of this would be to create a “deferred” context, with a root-based approach, rather than leaf-based, and where the global operations would be locally overriden within a context, e.g. overriding the __getattr__, __getitem__, __or__, __and__ of roots a, b, c in :

WithDeferredContext{ a | b & c[d].e }  # pseudo-code

Not sure it is pythonic (thus viable) though, because it is a mini-language.
But it would cover PEP 505 issues and possibly more…

Totally legit. I think if you want to do such specialized stuff, you better use explicitly specialized operations, because you can specialize yourself in understanding the specialized ops, and leave the general operators alone.

1 Like