You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Run mypy --strict src/cobib/config/event.py with mypy -V >= 0.930
Expected Behavior
No errors should occur.
Actual Behavior
I obtain the following errors:
src/cobib/config/event.py:137: error: Attempted to reuse member name "PostAddCommand" in Enum definition "Event" [misc]
src/cobib/config/event.py:222: error: Attempted to reuse member name "PostImportCommand" in Enum definition "Event" [misc]
src/cobib/config/event.py:445: error: Attempted to reuse member name "PostBibtexParse" in Enum definition "Event" [misc]
src/cobib/config/event.py:498: error: Attempted to reuse member name "PostYAMLParse" in Enum definition "Event" [misc]
src/cobib/config/event.py:551: error: Attempted to reuse member name "PostArxivParse" in Enum definition "Event" [misc]
src/cobib/config/event.py:578: error: Attempted to reuse member name "PostDOIParse" in Enum definition "Event" [misc]
src/cobib/config/event.py:605: error: Attempted to reuse member name "PostISBNParse" in Enum definition "Event" [misc]
src/cobib/config/event.py:632: error: Attempted to reuse member name "PostURLParse" in Enum definition "Event" [misc]
src/cobib/config/event.py:663: error: Attempted to reuse member name "PostZoteroImport" in Enum definition "Event" [misc]
Your Environment
Mypy version used: 0.930 and 0.931
Mypy command-line flags: --strict
Mypy configuration options from mypy.ini (and other config files):
The reason that I believe this to be necessary is open inspecting the runtime data during the offending scenarios. There I was able to extract the following names: SymbolTable object:
Bug Report
False positives for Enum member reuse attempts when an Enum has a large number of entries.
I first encountered this issue here
To Reproduce
Unfortunately, I have not yet found a minimal reproducing example.
mypy --strict src/cobib/config/event.py
withmypy -V >= 0.930
Expected Behavior
No errors should occur.
Actual Behavior
I obtain the following errors:
Your Environment
--strict
mypy.ini
(and other config files):python:latest
Docker containerMore information
I believe that this bug was introduced as part of #11267. It introduced the following line: https://github.com/python/mypy/blob/48d810d/mypy/semanal.py#L2874
Instead, I would expect this line to look more like https://github.com/python/mypy/blob/48d810d/mypy/semanal.py#L453 (i.e. also allow
PlaceholderNode
objects.The reason that I believe this to be necessary is open inspecting the runtime data during the offending scenarios. There I was able to extract the following
names: SymbolTable
object:This is just prior to this error being raised:
The following are the
lvalue
andnames[name]
at this specific occurrence.I am going to open a PR in a second with a suggestion to fix this by also allowing
PlaceholderNode
objects.The text was updated successfully, but these errors were encountered: