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
Are you reporting a bug, or opening a feature request?
Bug
Please insert below the code you are checking with mypy,
or a mock-up repro if the source is private. We would appreciate
if you try to simplify your case to a minimal repro.
@dataclassclassCategory():
"""Represents an arXiv category."""id: str=field(default_factory=str)
"""The category identifier (e.g. cs.DL)."""name: str=field(init=False)
"""The name of the category (e.g. Digital Libraries)."""def__post_init__(self) ->None:
"""Get the full category name."""ifself.idintaxonomy.CATEGORIES:
self.name=taxonomy.CATEGORIES[self.id]['name']
@dataclassclassArchive(Category):
"""Represents an arXiv archive."""def__post_init__(self) ->None:
"""Get the full archive name."""ifself.idintaxonomy.ARCHIVES:
self.name=taxonomy.ARCHIVES[self.id]['name']
What is the actual behavior/output?
I get a Unexpected keyword argument for id when trying to create instances of Abstract.
What is the behavior/output you expect?
No type errors.
What are the versions of mypy and Python you are using?
I haven't tried git master:
python = 3.6.6
mypy = 0.620
What are the mypy flags you are using? (For example --strict-optional)
mypy.ini:
[mypy]
#mypy_path = $MYPYPATH
#
# Covered by --strict, with some turned off:
#
disallow_untyped_calls=True
disallow_untyped_defs=True
check_untyped_defs=True
# currently an issue with sql alchemy
disallow_subclassing_any=false
# Need to experiment/think about this one:
disallow_any_decorated=false
warn_redundant_casts=True
warn_return_any=True
warn_unused_ignores=True
# this seems to be at least somewhat non-functioning:
warn_unused_configs=True
#may be worth reconsidering this one:
no_implicit_optional=True
strict_optional=True
#
# Other:
#
ignore_missing_imports=True
[mypy-sqlalchemy.*]
disallow_untyped_calls=False
disallow_untyped_defs=False
I cannot reproduce this, but my guess is that you are using ignore_missing_imports=True together with Python 3.6, so this is probably just a duplicate of #5389. Could you please try running with --python-version=3.7 (and --no-site-packages if needed)? And reopen if you find a repro.
Bug
or a mock-up repro if the source is private. We would appreciate
if you try to simplify your case to a minimal repro.
Code where the error occurs:
dataclass defs:
I get a
Unexpected keyword argument
forid
when trying to create instances ofAbstract
.No type errors.
I haven't tried git master:
python = 3.6.6
mypy = 0.620
mypy.ini:
Note: originally reported in #2852
The text was updated successfully, but these errors were encountered: