CarliJoy / intersection_examples

Python Typing Intersection examples
MIT License
20 stars 2 forks source link

Mention order of operations #18

Closed NeilGirdhar closed 3 months ago

NeilGirdhar commented 10 months ago

And has higher precedence than or, so intersection should have higher precedence than union.

kmillikin commented 10 months ago

That's conveniently what we get from & and |.

NeilGirdhar commented 10 months ago

True. Should we mention it in the PEP or is it obvious enough?

kmillikin commented 10 months ago

I think it's worth mentioning that it's a consequence of Python's operator precedence. No reason to leave a doubt about the PEP author's intention.