This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author larry
Recipients larry
Date 2021-04-08.11:09:29
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
The implementation of the | operator for TypeVar objects is as follows:

    def __or__(self, right):
        return Union[self, right]

    def __ror__(self, right):
        return Union[self, right]

I think the implementation of __ror__ is ever-so-slightly inaccurate.  Shouldn't it be this?

    def __ror__(self, left):
        return Union[left, self]

I assume this wouldn't affect runtime behavior, as unions are sets and are presumably unordered.  The only observable difference should be in the repr() (and only then if both are non-None), as this reverses the elements.  The repr for Union does preserve the order of the elements it contains, so it's visible to the user there.
Date User Action Args
2021-04-08 11:09:29larrysetrecipients: + larry
2021-04-08 11:09:29larrysetmessageid: <>
2021-04-08 11:09:29larrylinkissue43772 messages
2021-04-08 11:09:29larrycreate