On Fri, Aug 30, 2019 at 7:59 AM Andrew Barnert <abarnert@yahoo.com> wrote:
On Aug 29, 2019, at 12:54, Chris Angelico <rosuav@gmail.com> wrote:
Either one seems a lot better than breaking backward compatibility by adding new operator methods to the type type.
How does that break backward compat?
It doesn’t make Python backward incompatible; it does mean that if typing or mypy relies on it, it becomes incompatible with earlier versions of Python (or has to fork different code for 3.8+ that relies on type.__or__ being available and 3.7- that doesn’t have whatever functionality relies on that).
Ohh, gotcha. I'd describe that not as breaking backward compatibility but as breaking the backport (in that typing.py can easily be backported but core types can't). Still, I think it would be a valuable enhancement, even if it can't be depended upon for older versions - anything needing compatibility can have identical functionality with the longer spelling. ChrisA