-
Notifications
You must be signed in to change notification settings - Fork 15.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Automated rollback of commit f799af8.
PiperOrigin-RevId: 629760811
- Loading branch information
1 parent
9c8e0e6
commit c4bf83b
Showing
2 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,8 @@ | |
reflection_test.py | ||
""" | ||
|
||
import sys | ||
|
||
__author__ = '[email protected] (Kevin Rabsatt)' | ||
|
||
|
||
|
@@ -99,3 +101,12 @@ def __getattr__(self, name): | |
pass # fall out to break exception chaining | ||
raise AttributeError('Enum {} has no value defined for name {!r}'.format( | ||
self._enum_type.name, name)) | ||
|
||
def __or__(self, other): | ||
"""Returns the union type of self and other.""" | ||
if sys.version_info >= (3, 10): | ||
return type(self) | other | ||
else: | ||
raise NotImplementedError( | ||
'You may not use | on EnumTypes (or classes) below python 3.10' | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters