Repository navigation
Conversation
Contributor
|
Diff from mypy_primer, showing the effect of this PR on open source code: strawberry (https://github.com/strawberry-graphql/strawberry)
+ strawberry/types/field.py:348: error: Unused "type: ignore" comment [unused-ignore]
sphinx (https://github.com/sphinx-doc/sphinx)
+ sphinx/builders/_epub_base.py:34:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
+ sphinx/testing/util.py:80:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
|
| get_proper_type(self.ret_type), UninhabitedType | ||
| return self.fallback.type.is_metaclass() and ( | ||
| self.instance_type is not None | ||
| or not isinstance(get_proper_type(self.ret_type), UninhabitedType) |
Collaborator
There was a problem hiding this comment.
is the or not isinstance(get_proper_type(self.ret_type), UninhabitedType) still needed (after #21441)? can we remove it?
Author
There was a problem hiding this comment.
if remove only or not isinstance(get_proper_type(self.ret_type), UninhabitedType) in pytest-fast failed 11 tests:
FAILED mypy/test/testcheck.py::TypeCheckSuite::check-dataclasses.test::testDataclassDefaultFactoryTypedDict - data: [PROJECT_ROOT]\test-data\unit\check-dataclasses.test:2893:
FAILED mypy/test/testcheck.py::TypeCheckSuite::check-type-object-type-inference.test::testInferTupleType - data: [PROJECT_ROOT]\test-data\unit\check-type-object-type-inference.test:1:
FAILED mypy/test/testdeps.py::GetDependenciesSuite::deps.test::testTypedDict - data: [PROJECT_ROOT]\test-data\unit\deps.test:659:
FAILED mypy/test/testdeps.py::GetDependenciesSuite::deps.test::testTypedDict2 - data: [PROJECT_ROOT]\test-data\unit\deps.test:673:
FAILED mypy/test/testdeps.py::GetDependenciesSuite::deps.test::testTypedDict3 - data: [PROJECT_ROOT]\test-data\unit\deps.test:691:
FAILED mypy/test/testcheck.py::TypeCheckSuite::check-typeddict.test::testTypedDictWithIsInstanceAndIsSubclass - data: [PROJECT_ROOT]\test-data\unit\check-typeddict.test:961:
FAILED mypy/test/testcheck.py::TypeCheckSuite::check-typeddict.test::testGenericTypedDictCreation - data: [PROJECT_ROOT]\test-data\unit\check-typeddict.test:3302:
FAILED mypy/test/testcheck.py::TypeCheckSuite::check-typeddict.test::testTypedDictAttributeOnClassObject - data: [PROJECT_ROOT]\test-data\unit\check-typeddict.test:3414:
FAILED mypy/test/testcheck.py::TypeCheckSuite::check-typeddict.test::testGenericTypedDictCallSyntax - data: [PROJECT_ROOT]\test-data\unit\check-typeddict.test:3465:
FAILED mypy/test/testtypes.py::JoinSuite::test_simple_type_objects - assert False
FAILED mypy/test/testsubtypes.py::SubtypingSuite::test_type_callable_subtyping - AssertionError: def (A) -> B subtype of def (A) -> B
if save only return self.fallback.type.is_metaclass(), tests pass, but get_instance_type may start returning UninhabitedType, and then type_object will fail on assert isinstance(instance_type, Instance) (on types created by plugins that do not set instance_type, but ret_type is UninhabitedType).
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #16981
If __new__/__init__ return Never/NoReturn, after this fix, you can get attribute/method from class.