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?
More of a feature request/question.
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.
The following is a mock up and not fully implemented. I would like to define a class for which the defined functions and the statements written in main() will not raise mypy errors with the config file I've given below. Or at least I would like to know if this is possible or not.
asta/demo.py:49: error: "AType" expects no type arguments, but 1 given [type-arg]
asta/demo.py:53: error: Unexpected '...' [misc]
asta/demo.py:53: error: "AType" expects no type arguments, but 1 given [type-arg]
asta/demo.py:57: error: "AType" expects no type arguments, but 1 given [type-arg]
What is the behavior/output you expect?
I would like the above to raise no mypy errors for someone using the class AType in their own projects. I'm fine with disabling errors in the source code of the class/metaclass definitions, but I would like to be able to use AType in place of a subscriptable generic type in type hints, and raise no errors if passed None, ..., '(int, int), or intfor example. Inheriting fromGeneric[T]is out of the question because it will make mypy complain aboutisinstance()` checks.
What are the versions of mypy and Python you are using?
Python 3.7.6
Mypy 0.761
Do you see the same issue after installing mypy from Git master?
I trying to determine if this is possible for the latest version available from pip.
What are the mypy flags you are using? (For example --strict-optional)
See above. Ran with mypy <directory>.
If mypy crashed with a traceback, please paste
the full traceback below.
Did not crash.
(You can freely edit this text, please remove all the lines
you believe are unnecessary.)
The text was updated successfully, but these errors were encountered:
More of a feature request/question.
or a mock-up repro if the source is private. We would appreciate
if you try to simplify your case to a minimal repro.
The following is a mock up and not fully implemented. I would like to define a class for which the defined functions and the statements written in
main()
will not raise mypy errors with the config file I've given below. Or at least I would like to know if this is possible or not.Given the following mypy config:
Mypy output:
What is the behavior/output you expect?
I would like the above to raise no mypy errors for someone using the class
AType
in their own projects. I'm fine with disabling errors in the source code of the class/metaclass definitions, but I would like to be able to useAType
in place of a subscriptable generic type in type hints, and raise no errors if passedNone
,...
, '(int, int), or
intfor example. Inheriting from
Generic[T]is out of the question because it will make mypy complain about
isinstance()` checks.What are the versions of mypy and Python you are using?
Python 3.7.6
Mypy 0.761
Do you see the same issue after installing mypy from Git master?
I trying to determine if this is possible for the latest version available from pip.
What are the mypy flags you are using? (For example --strict-optional)
See above. Ran with
mypy <directory>
.If mypy crashed with a traceback, please paste
the full traceback below.
Did not crash.
(You can freely edit this text, please remove all the lines
you believe are unnecessary.)
The text was updated successfully, but these errors were encountered: