Bug Report
#11579 seems to fix #11578 in the 0.930 release, but still there are edge cases.
To Reproduce
Here is a minimal reproduction example.
importenumclassStringSetFlag(enum.Flag):
def__eq__(self, other):
returnself.value==otherdef__hash__(self):
returnhash(self.value)
def__or__(self, other):
ifisinstance(other, type(self)):
other=other.valueifnotisinstance(other, (set, frozenset)):
other=set((other,))
returnset((self.value,)) |other__ror__=__or__# this line makes the errorclassMyFlags(StringSetFlag):
X="x"Y="y"
Expected Behavior
It should be accepted in type check.
Actual Behavior
test-enum.py:22: error: Cannot inherit from final class "StringSetFlag"
Found 1 error in 1 file (checked 1 source file)
Your Environment
- Mypy version used: 0.930
- Mypy command-line flags:
python -m mypy test-enum.py - Mypy configuration options from
mypy.ini (and other config files):
[mypy]
ignore_missing_imports = true
mypy_path = stubs,src
namespace_packages = true
explicit_package_bases = true
- Python version used: 3.9.7
- Operating system and version: Ubuntu 20.04 (amd64)
Bug Report
#11579 seems to fix #11578 in the 0.930 release, but still there are edge cases.
To Reproduce
Here is a minimal reproduction example.
Expected Behavior
It should be accepted in type check.
Actual Behavior
Your Environment
python -m mypy test-enum.pymypy.ini(and other config files):