-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improved error reporting for "async with" statement. Added check that… #9697
Merged
Conversation
This file contains 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
… return result of `__aexit__` is awaitable and improved error messages for the case where `__enter__`, etc. are present but have incorrect signatures. This addresses #9694.
Diff from mypy_primer, showing the effect of this PR on open source code: pytest (https://github.com/pytest-dev/pytest)
- /tmp/mypy_primer/projects/pytest/testing/io/test_terminalwriter.py:94:14 - error: Object of type "Unbound" cannot be used with "with" because it does not implement __enter__ (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/pytest/testing/io/test_terminalwriter.py:94:14 - error: Object of type "Unbound" cannot be used with "with" because it does not correctly implement __enter__ (reportGeneralTypeIssues)
- /tmp/mypy_primer/projects/pytest/testing/io/test_terminalwriter.py:94:14 - error: Object of type "Unbound" cannot be used with "with" because it does not implement __exit__ (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/pytest/testing/io/test_terminalwriter.py:94:14 - error: Object of type "Unbound" cannot be used with "with" because it does not correctly implement __exit__ (reportGeneralTypeIssues)
sympy (https://github.com/sympy/sympy)
- /tmp/mypy_primer/projects/sympy/sympy/core/tests/test_arit.py:1845:10 - error: Object of type "ExceptionInfo" cannot be used with "with" because it does not implement __enter__
+ /tmp/mypy_primer/projects/sympy/sympy/core/tests/test_arit.py:1845:10 - error: Object of type "ExceptionInfo" cannot be used with "with" because it does not correctly implement __enter__
- /tmp/mypy_primer/projects/sympy/sympy/core/tests/test_arit.py:1845:10 - error: Object of type "ExceptionInfo" cannot be used with "with" because it does not implement __exit__ (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/sympy/sympy/core/tests/test_arit.py:1845:10 - error: Object of type "ExceptionInfo" cannot be used with "with" because it does not correctly implement __exit__
+ Attribute "__exit__" is unknown (reportGeneralTypeIssues)
- /tmp/mypy_primer/projects/sympy/sympy/core/tests/test_assumptions.py:695:10 - error: Object of type "ExceptionInfo" cannot be used with "with" because it does not implement __enter__
+ /tmp/mypy_primer/projects/sympy/sympy/core/tests/test_assumptions.py:695:10 - error: Object of type "ExceptionInfo" cannot be used with "with" because it does not correctly implement __enter__
- /tmp/mypy_primer/projects/sympy/sympy/core/tests/test_assumptions.py:695:10 - error: Object of type "ExceptionInfo" cannot be used with "with" because it does not implement __exit__ (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/sympy/sympy/core/tests/test_assumptions.py:695:10 - error: Object of type "ExceptionInfo" cannot be used with "with" because it does not correctly implement __exit__
+ Attribute "__exit__" is unknown (reportGeneralTypeIssues)
- /tmp/mypy_primer/projects/sympy/sympy/core/tests/test_basic.py:48:10 - error: Object of type "ExceptionInfo" cannot be used with "with" because it does not implement __enter__
+ /tmp/mypy_primer/projects/sympy/sympy/core/tests/test_basic.py:48:10 - error: Object of type "ExceptionInfo" cannot be used with "with" because it does not correctly implement __enter__
- /tmp/mypy_primer/projects/sympy/sympy/core/tests/test_basic.py:48:10 - error: Object of type "ExceptionInfo" cannot be used with "with" because it does not implement __exit__ (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/sympy/sympy/core/tests/test_basic.py:48:10 - error: Object of type "ExceptionInfo" cannot be used with "with" because it does not correctly implement __exit__
+ Attribute "__exit__" is unknown (reportGeneralTypeIssues)
- /tmp/mypy_primer/projects/sympy/sympy/core/tests/test_containers.py:184:10 - error: Object of type "ExceptionInfo" cannot be used with "with" because it does not implement __enter__
+ /tmp/mypy_primer/projects/sympy/sympy/core/tests/test_containers.py:184:10 - error: Object of type "ExceptionInfo" cannot be used with "with" because it does not correctly implement __enter__
- /tmp/mypy_primer/projects/sympy/sympy/core/tests/test_containers.py:184:10 - error: Object of type "ExceptionInfo" cannot be used with "with" because it does not implement __exit__ (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/sympy/sympy/core/tests/test_containers.py:184:10 - error: Object of type "ExceptionInfo" cannot be used with "with" because it does not correctly implement __exit__
+ Attribute "__exit__" is unknown (reportGeneralTypeIssues)
- /tmp/mypy_primer/projects/sympy/sympy/core/tests/test_function.py:1451:10 - error: Object of type "ExceptionInfo" cannot be used with "with" because it does not implement __enter__
+ /tmp/mypy_primer/projects/sympy/sympy/core/tests/test_function.py:1451:10 - error: Object of type "ExceptionInfo" cannot be used with "with" because it does not correctly implement __enter__
- /tmp/mypy_primer/projects/sympy/sympy/core/tests/test_function.py:1451:10 - error: Object of type "ExceptionInfo" cannot be used with "with" because it does not implement __exit__ (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/sympy/sympy/core/tests/test_function.py:1451:10 - error: Object of type "ExceptionInfo" cannot be used with "with" because it does not correctly implement __exit__
+ Attribute "__exit__" is unknown (reportGeneralTypeIssues)
- /tmp/mypy_primer/projects/sympy/sympy/core/tests/test_numbers.py:1458:10 - error: Object of type "ExceptionInfo" cannot be used with "with" because it does not implement __enter__
+ /tmp/mypy_primer/projects/sympy/sympy/core/tests/test_numbers.py:1458:10 - error: Object of type "ExceptionInfo" cannot be used with "with" because it does not correctly implement __enter__
- /tmp/mypy_primer/projects/sympy/sympy/core/tests/test_numbers.py:1458:10 - error: Object of type "ExceptionInfo" cannot be used with "with" because it does not implement __exit__ (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/sympy/sympy/core/tests/test_numbers.py:1458:10 - error: Object of type "ExceptionInfo" cannot be used with "with" because it does not correctly implement __exit__
+ Attribute "__exit__" is unknown (reportGeneralTypeIssues)
- /tmp/mypy_primer/projects/sympy/sympy/core/tests/test_sympify.py:278:10 - error: Object of type "ExceptionInfo" cannot be used with "with" because it does not implement __enter__
+ /tmp/mypy_primer/projects/sympy/sympy/core/tests/test_sympify.py:278:10 - error: Object of type "ExceptionInfo" cannot be used with "with" because it does not correctly implement __enter__
- /tmp/mypy_primer/projects/sympy/sympy/core/tests/test_sympify.py:278:10 - error: Object of type "ExceptionInfo" cannot be used with "with" because it does not implement __exit__ (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/sympy/sympy/core/tests/test_sympify.py:278:10 - error: Object of type "ExceptionInfo" cannot be used with "with" because it does not correctly implement __exit__
+ Attribute "__exit__" is unknown (reportGeneralTypeIssues)
- /tmp/mypy_primer/projects/sympy/sympy/diffgeom/tests/test_diffgeom.py:32:10 - error: Object of type "ExceptionInfo" cannot be used with "with" because it does not implement __enter__
+ /tmp/mypy_primer/projects/sympy/sympy/diffgeom/tests/test_diffgeom.py:32:10 - error: Object of type "ExceptionInfo" cannot be used with "with" because it does not correctly implement __enter__
- /tmp/mypy_primer/projects/sympy/sympy/diffgeom/tests/test_diffgeom.py:32:10 - error: Object of type "ExceptionInfo" cannot be used with "with" because it does not implement __exit__ (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/sympy/sympy/diffgeom/tests/test_diffgeom.py:32:10 - error: Object of type "ExceptionInfo" cannot be used with "with" because it does not correctly implement __exit__
+ Attribute "__exit__" is unknown (reportGeneralTypeIssues)
- /tmp/mypy_primer/projects/sympy/sympy/diffgeom/tests/test_diffgeom.py:41:10 - error: Object of type "ExceptionInfo" cannot be used with "with" because it does not implement __enter__
+ /tmp/mypy_primer/projects/sympy/sympy/diffgeom/tests/test_diffgeom.py:41:10 - error: Object of type "ExceptionInfo" cannot be used with "with" because it does not correctly implement __enter__
- /tmp/mypy_primer/projects/sympy/sympy/diffgeom/tests/test_diffgeom.py:41:10 - error: Object of type "ExceptionInfo" cannot be used with "with" because it does not implement __exit__ (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/sympy/sympy/diffgeom/tests/test_diffgeom.py:41:10 - error: Object of type "ExceptionInfo" cannot be used with "with" because it does not correctly implement __exit__
+ Attribute "__exit__" is unknown (reportGeneralTypeIssues)
- /tmp/mypy_primer/projects/sympy/sympy/external/tests/test_numpy.py:250:14 - error: Object of type "ExceptionInfo" cannot be used with "with" because it does not implement __enter__
+ /tmp/mypy_primer/projects/sympy/sympy/external/tests/test_numpy.py:250:14 - error: Object of type "ExceptionInfo" cannot be used with "with" because it does not correctly implement __enter__
- /tmp/mypy_primer/projects/sympy/sympy/external/tests/test_numpy.py:250:14 - error: Object of type "ExceptionInfo" cannot be used with "with" because it does not implement __exit__ (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/sympy/sympy/external/tests/test_numpy.py:250:14 - error: Object of type "ExceptionInfo" cannot be used with "with" because it does not correctly implement __exit__
+ Attribute "__exit__" is unknown (reportGeneralTypeIssues)
- /tmp/mypy_primer/projects/sympy/sympy/external/tests/test_numpy.py:253:14 - error: Object of type "ExceptionInfo" cannot be used with "with" because it does not implement __enter__
+ /tmp/mypy_primer/projects/sympy/sympy/external/tests/test_numpy.py:253:14 - error: Object of type "ExceptionInfo" cannot be used with "with" because it does not correctly implement __enter__
- /tmp/mypy_primer/projects/sympy/sympy/external/tests/test_numpy.py:253:14 - error: Object of type "ExceptionInfo" cannot be used with "with" because it does not implement __exit__ (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/sympy/sympy/external/tests/test_numpy.py:253:14 - error: Object of type "ExceptionInfo" cannot be used with "with" because it does not correctly implement __exit__
+ Attribute "__exit__" is unknown (reportGeneralTypeIssues)
- /tmp/mypy_primer/projects/sympy/sympy/matrices/tests/test_immutable.py:27:10 - error: Object of type "ExceptionInfo" cannot be used with "with" because it does not implement __enter__
+ /tmp/mypy_primer/projects/sympy/sympy/matrices/tests/test_immutable.py:27:10 - error: Object of type "ExceptionInfo" cannot be used with "with" because it does not correctly implement __enter__
- /tmp/mypy_primer/projects/sympy/sympy/matrices/tests/test_immutable.py:27:10 - error: Object of type "ExceptionInfo" cannot be used with "with" because it does not implement __exit__ (reportGeneralTypeIssues)
... (truncated 502 lines) ...
apprise (https://github.com/caronc/apprise)
- /tmp/mypy_primer/projects/apprise/test/test_attach_memory.py:64:10 - error: Object of type "AttachMemory" cannot be used with "with" because it does not implement __exit__ (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/apprise/test/test_attach_memory.py:64:10 - error: Object of type "AttachMemory" cannot be used with "with" because it does not correctly implement __exit__
+ Attribute "__exit__" is unknown (reportGeneralTypeIssues)
- /tmp/mypy_primer/projects/apprise/test/test_attach_memory.py:117:10 - error: Object of type "AttachMemory" cannot be used with "with" because it does not implement __exit__ (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/apprise/test/test_attach_memory.py:117:10 - error: Object of type "AttachMemory" cannot be used with "with" because it does not correctly implement __exit__
+ Attribute "__exit__" is unknown (reportGeneralTypeIssues)
- /tmp/mypy_primer/projects/apprise/test/test_attach_memory.py:145:10 - error: Object of type "AttachMemory" cannot be used with "with" because it does not implement __exit__ (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/apprise/test/test_attach_memory.py:145:10 - error: Object of type "AttachMemory" cannot be used with "with" because it does not correctly implement __exit__
+ Attribute "__exit__" is unknown (reportGeneralTypeIssues)
- /tmp/mypy_primer/projects/apprise/test/test_attach_memory.py:156:10 - error: Object of type "AttachMemory" cannot be used with "with" because it does not implement __exit__ (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/apprise/test/test_attach_memory.py:156:10 - error: Object of type "AttachMemory" cannot be used with "with" because it does not correctly implement __exit__
+ Attribute "__exit__" is unknown (reportGeneralTypeIssues)
- /tmp/mypy_primer/projects/apprise/test/test_attach_memory.py:162:10 - error: Object of type "AttachMemory" cannot be used with "with" because it does not implement __exit__ (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/apprise/test/test_attach_memory.py:162:10 - error: Object of type "AttachMemory" cannot be used with "with" because it does not correctly implement __exit__
+ Attribute "__exit__" is unknown (reportGeneralTypeIssues)
- /tmp/mypy_primer/projects/apprise/test/test_attach_memory.py:178:10 - error: Object of type "AttachMemory" cannot be used with "with" because it does not implement __exit__ (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/apprise/test/test_attach_memory.py:178:10 - error: Object of type "AttachMemory" cannot be used with "with" because it does not correctly implement __exit__
+ Attribute "__exit__" is unknown (reportGeneralTypeIssues)
- /tmp/mypy_primer/projects/apprise/test/test_attach_memory.py:194:10 - error: Object of type "AttachMemory" cannot be used with "with" because it does not implement __exit__ (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/apprise/test/test_attach_memory.py:194:10 - error: Object of type "AttachMemory" cannot be used with "with" because it does not correctly implement __exit__
+ Attribute "__exit__" is unknown (reportGeneralTypeIssues)
scikit-learn (https://github.com/scikit-learn/scikit-learn)
- /tmp/mypy_primer/projects/scikit-learn/sklearn/cluster/tests/test_hierarchical.py:109:14 - error: Object of type "_Wrapped[..., Unknown, ..., Unknown]" cannot be used with "with" because it does not implement __enter__
+ /tmp/mypy_primer/projects/scikit-learn/sklearn/cluster/tests/test_hierarchical.py:109:14 - error: Object of type "_Wrapped[..., Unknown, ..., Unknown]" cannot be used with "with" because it does not correctly implement __enter__
- /tmp/mypy_primer/projects/scikit-learn/sklearn/cluster/tests/test_hierarchical.py:109:14 - error: Object of type "_Wrapped[..., Unknown, ..., Unknown]" cannot be used with "with" because it does not implement __exit__ (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/scikit-learn/sklearn/cluster/tests/test_hierarchical.py:109:14 - error: Object of type "_Wrapped[..., Unknown, ..., Unknown]" cannot be used with "with" because it does not correctly implement __exit__
+ Attribute "__exit__" is unknown (reportGeneralTypeIssues)
- /tmp/mypy_primer/projects/scikit-learn/sklearn/cluster/tests/test_hierarchical.py:117:18 - error: Object of type "_Wrapped[..., Unknown, ..., Unknown]" cannot be used with "with" because it does not implement __enter__
+ /tmp/mypy_primer/projects/scikit-learn/sklearn/cluster/tests/test_hierarchical.py:117:18 - error: Object of type "_Wrapped[..., Unknown, ..., Unknown]" cannot be used with "with" because it does not correctly implement __enter__
- /tmp/mypy_primer/projects/scikit-learn/sklearn/cluster/tests/test_hierarchical.py:117:18 - error: Object of type "_Wrapped[..., Unknown, ..., Unknown]" cannot be used with "with" because it does not implement __exit__ (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/scikit-learn/sklearn/cluster/tests/test_hierarchical.py:117:18 - error: Object of type "_Wrapped[..., Unknown, ..., Unknown]" cannot be used with "with" because it does not correctly implement __exit__
+ Attribute "__exit__" is unknown (reportGeneralTypeIssues)
- /tmp/mypy_primer/projects/scikit-learn/sklearn/decomposition/tests/test_dict_learning.py:248:14 - error: Object of type "_Wrapped[..., Unknown, ..., Unknown]" cannot be used with "with" because it does not implement __enter__
+ /tmp/mypy_primer/projects/scikit-learn/sklearn/decomposition/tests/test_dict_learning.py:248:14 - error: Object of type "_Wrapped[..., Unknown, ..., Unknown]" cannot be used with "with" because it does not correctly implement __enter__
- /tmp/mypy_primer/projects/scikit-learn/sklearn/decomposition/tests/test_dict_learning.py:248:14 - error: Object of type "_Wrapped[..., Unknown, ..., Unknown]" cannot be used with "with" because it does not implement __exit__ (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/scikit-learn/sklearn/decomposition/tests/test_dict_learning.py:248:14 - error: Object of type "_Wrapped[..., Unknown, ..., Unknown]" cannot be used with "with" because it does not correctly implement __exit__
+ Attribute "__exit__" is unknown (reportGeneralTypeIssues)
- /tmp/mypy_primer/projects/scikit-learn/sklearn/decomposition/tests/test_fastica.py:453:14 - error: Object of type "_Wrapped[..., Unknown, ..., Unknown]" cannot be used with "with" because it does not implement __enter__
+ /tmp/mypy_primer/projects/scikit-learn/sklearn/decomposition/tests/test_fastica.py:453:14 - error: Object of type "_Wrapped[..., Unknown, ..., Unknown]" cannot be used with "with" because it does not correctly implement __enter__
- /tmp/mypy_primer/projects/scikit-learn/sklearn/decomposition/tests/test_fastica.py:453:14 - error: Object of type "_Wrapped[..., Unknown, ..., Unknown]" cannot be used with "with" because it does not implement __exit__ (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/scikit-learn/sklearn/decomposition/tests/test_fastica.py:453:14 - error: Object of type "_Wrapped[..., Unknown, ..., Unknown]" cannot be used with "with" because it does not correctly implement __exit__
+ Attribute "__exit__" is unknown (reportGeneralTypeIssues)
- /tmp/mypy_primer/projects/scikit-learn/sklearn/ensemble/tests/test_forest.py:1149:10 - error: Object of type "_Wrapped[..., Unknown, ..., Unknown]" cannot be used with "with" because it does not implement __enter__
+ /tmp/mypy_primer/projects/scikit-learn/sklearn/ensemble/tests/test_forest.py:1149:10 - error: Object of type "_Wrapped[..., Unknown, ..., Unknown]" cannot be used with "with" because it does not correctly implement __enter__
- /tmp/mypy_primer/projects/scikit-learn/sklearn/ensemble/tests/test_forest.py:1149:10 - error: Object of type "_Wrapped[..., Unknown, ..., Unknown]" cannot be used with "with" because it does not implement __exit__ (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/scikit-learn/sklearn/ensemble/tests/test_forest.py:1149:10 - error: Object of type "_Wrapped[..., Unknown, ..., Unknown]" cannot be used with "with" because it does not correctly implement __exit__
+ Attribute "__exit__" is unknown (reportGeneralTypeIssues)
- /tmp/mypy_primer/projects/scikit-learn/sklearn/ensemble/tests/test_iforest.py:43:10 - error: Object of type "_Wrapped[..., Unknown, ..., Unknown]" cannot be used with "with" because it does not implement __enter__
+ /tmp/mypy_primer/projects/scikit-learn/sklearn/ensemble/tests/test_iforest.py:43:10 - error: Object of type "_Wrapped[..., Unknown, ..., Unknown]" cannot be used with "with" because it does not correctly implement __enter__
- /tmp/mypy_primer/projects/scikit-learn/sklearn/ensemble/tests/test_iforest.py:43:10 - error: Object of type "_Wrapped[..., Unknown, ..., Unknown]" cannot be used with "with" because it does not implement __exit__ (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/scikit-learn/sklearn/ensemble/tests/test_iforest.py:43:10 - error: Object of type "_Wrapped[..., Unknown, ..., Unknown]" cannot be used with "with" because it does not correctly implement __exit__
+ Attribute "__exit__" is unknown (reportGeneralTypeIssues)
- /tmp/mypy_primer/projects/scikit-learn/sklearn/ensemble/tests/test_stacking.py:475:10 - error: Object of type "_Wrapped[..., Unknown, ..., Unknown]" cannot be used with "with" because it does not implement __enter__
+ /tmp/mypy_primer/projects/scikit-learn/sklearn/ensemble/tests/test_stacking.py:475:10 - error: Object of type "_Wrapped[..., Unknown, ..., Unknown]" cannot be used with "with" because it does not correctly implement __enter__
- /tmp/mypy_primer/projects/scikit-learn/sklearn/ensemble/tests/test_stacking.py:475:10 - error: Object of type "_Wrapped[..., Unknown, ..., Unknown]" cannot be used with "with" because it does not implement __exit__ (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/scikit-learn/sklearn/ensemble/tests/test_stacking.py:475:10 - error: Object of type "_Wrapped[..., Unknown, ..., Unknown]" cannot be used with "with" because it does not correctly implement __exit__
+ Attribute "__exit__" is unknown (reportGeneralTypeIssues)
- /tmp/mypy_primer/projects/scikit-learn/sklearn/ensemble/tests/test_stacking.py:479:10 - error: Object of type "_Wrapped[..., Unknown, ..., Unknown]" cannot be used with "with" because it does not implement __enter__
+ /tmp/mypy_primer/projects/scikit-learn/sklearn/ensemble/tests/test_stacking.py:479:10 - error: Object of type "_Wrapped[..., Unknown, ..., Unknown]" cannot be used with "with" because it does not correctly implement __enter__
- /tmp/mypy_primer/projects/scikit-learn/sklearn/ensemble/tests/test_stacking.py:479:10 - error: Object of type "_Wrapped[..., Unknown, ..., Unknown]" cannot be used with "with" because it does not implement __exit__ (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/scikit-learn/sklearn/ensemble/tests/test_stacking.py:479:10 - error: Object of type "_Wrapped[..., Unknown, ..., Unknown]" cannot be used with "with" because it does not correctly implement __exit__
+ Attribute "__exit__" is unknown (reportGeneralTypeIssues)
- /tmp/mypy_primer/projects/scikit-learn/sklearn/ensemble/tests/test_stacking.py:485:10 - error: Object of type "_Wrapped[..., Unknown, ..., Unknown]" cannot be used with "with" because it does not implement __enter__
+ /tmp/mypy_primer/projects/scikit-learn/sklearn/ensemble/tests/test_stacking.py:485:10 - error: Object of type "_Wrapped[..., Unknown, ..., Unknown]" cannot be used with "with" because it does not correctly implement __enter__
- /tmp/mypy_primer/projects/scikit-learn/sklearn/ensemble/tests/test_stacking.py:485:10 - error: Object of type "_Wrapped[..., Unknown, ..., Unknown]" cannot be used with "with" because it does not implement __exit__ (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/scikit-learn/sklearn/ensemble/tests/test_stacking.py:485:10 - error: Object of type "_Wrapped[..., Unknown, ..., Unknown]" cannot be used with "with" because it does not correctly implement __exit__
+ Attribute "__exit__" is unknown (reportGeneralTypeIssues)
- /tmp/mypy_primer/projects/scikit-learn/sklearn/linear_model/tests/test_coordinate_descent.py:99:10 - error: Object of type "_Wrapped[..., Unknown, ..., Unknown]" cannot be used with "with" because it does not implement __enter__
+ /tmp/mypy_primer/projects/scikit-learn/sklearn/linear_model/tests/test_coordinate_descent.py:99:10 - error: Object of type "_Wrapped[..., Unknown, ..., Unknown]" cannot be used with "with" because it does not correctly implement __enter__
- /tmp/mypy_primer/projects/scikit-learn/sklearn/linear_model/tests/test_coordinate_descent.py:99:10 - error: Object of type "_Wrapped[..., Unknown, ..., Unknown]" cannot be used with "with" because it does not implement __exit__ (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/scikit-learn/sklearn/linear_model/tests/test_coordinate_descent.py:99:10 - error: Object of type "_Wrapped[..., Unknown, ..., Unknown]" cannot be used with "with" because it does not correctly implement __exit__
... (truncated 271 lines) ...
kopf (https://github.com/nolar/kopf)
- /tmp/mypy_primer/projects/kopf/kopf/_core/engines/admission.py:267:20 - error: Object of type "Never" cannot be used with "with" because it does not implement __aenter__ (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/kopf/kopf/_core/engines/admission.py:267:20 - error: Object of type "Never" cannot be used with "async with" because it does not correctly implement __aenter__ (reportGeneralTypeIssues)
- /tmp/mypy_primer/projects/kopf/kopf/_core/engines/admission.py:267:20 - error: Object of type "Never" cannot be used with "with" because it does not implement __aexit__ (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/kopf/kopf/_core/engines/admission.py:267:20 - error: Object of type "Never" cannot be used with "with" because it does not correctly implement __aexit__ (reportGeneralTypeIssues)
prefect (https://github.com/PrefectHQ/prefect)
- /tmp/mypy_primer/projects/prefect/src/integrations/prefect-dask/tests/test_utils.py:81:18 - error: Object of type "_AsyncGeneratorContextManager[Unknown]" cannot be used with "with" because it does not implement __enter__
+ /tmp/mypy_primer/projects/prefect/src/integrations/prefect-dask/tests/test_utils.py:81:18 - error: Object of type "_AsyncGeneratorContextManager[Unknown]" cannot be used with "with" because it does not correctly implement __enter__
- /tmp/mypy_primer/projects/prefect/src/integrations/prefect-dask/tests/test_utils.py:81:18 - error: Object of type "_AsyncGeneratorContextManager[Unknown]" cannot be used with "with" because it does not implement __exit__ (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/prefect/src/integrations/prefect-dask/tests/test_utils.py:81:18 - error: Object of type "_AsyncGeneratorContextManager[Unknown]" cannot be used with "with" because it does not correctly implement __exit__
+ Attribute "__exit__" is unknown (reportGeneralTypeIssues)
- /tmp/mypy_primer/projects/prefect/src/integrations/prefect-dask/tests/test_utils.py:111:18 - error: Object of type "_AsyncGeneratorContextManager[Unknown]" cannot be used with "with" because it does not implement __enter__
+ /tmp/mypy_primer/projects/prefect/src/integrations/prefect-dask/tests/test_utils.py:111:18 - error: Object of type "_AsyncGeneratorContextManager[Unknown]" cannot be used with "with" because it does not correctly implement __enter__
- /tmp/mypy_primer/projects/prefect/src/integrations/prefect-dask/tests/test_utils.py:111:18 - error: Object of type "_AsyncGeneratorContextManager[Unknown]" cannot be used with "with" because it does not implement __exit__ (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/prefect/src/integrations/prefect-dask/tests/test_utils.py:111:18 - error: Object of type "_AsyncGeneratorContextManager[Unknown]" cannot be used with "with" because it does not correctly implement __exit__
+ Attribute "__exit__" is unknown (reportGeneralTypeIssues)
- /tmp/mypy_primer/projects/prefect/src/integrations/prefect-docker/prefect_docker/containers.py:60:10 - error: Object of type "DockerClient" cannot be used with "with" because it does not implement __enter__
+ /tmp/mypy_primer/projects/prefect/src/integrations/prefect-docker/prefect_docker/containers.py:60:10 - error: Object of type "DockerClient" cannot be used with "with" because it does not correctly implement __enter__
- /tmp/mypy_primer/projects/prefect/src/integrations/prefect-docker/prefect_docker/containers.py:60:10 - error: Object of type "DockerClient" cannot be used with "with" because it does not implement __exit__ (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/prefect/src/integrations/prefect-docker/prefect_docker/containers.py:60:10 - error: Object of type "DockerClient" cannot be used with "with" because it does not correctly implement __exit__
+ Attribute "__exit__" is unknown (reportGeneralTypeIssues)
- /tmp/mypy_primer/projects/prefect/src/integrations/prefect-docker/prefect_docker/containers.py:110:10 - error: Object of type "DockerClient" cannot be used with "with" because it does not implement __enter__
+ /tmp/mypy_primer/projects/prefect/src/integrations/prefect-docker/prefect_docker/containers.py:110:10 - error: Object of type "DockerClient" cannot be used with "with" because it does not correctly implement __enter__
- /tmp/mypy_primer/projects/prefect/src/integrations/prefect-docker/prefect_docker/containers.py:110:10 - error: Object of type "DockerClient" cannot be used with "with" because it does not implement __exit__ (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/prefect/src/integrations/prefect-docker/prefect_docker/containers.py:110:10 - error: Object of type "DockerClient" cannot be used with "with" because it does not correctly implement __exit__
+ Attribute "__exit__" is unknown (reportGeneralTypeIssues)
- /tmp/mypy_primer/projects/prefect/src/integrations/prefect-docker/prefect_docker/containers.py:152:10 - error: Object of type "DockerClient" cannot be used with "with" because it does not implement __enter__
+ /tmp/mypy_primer/projects/prefect/src/integrations/prefect-docker/prefect_docker/containers.py:152:10 - error: Object of type "DockerClient" cannot be used with "with" because it does not correctly implement __enter__
- /tmp/mypy_primer/projects/prefect/src/integrations/prefect-docker/prefect_docker/containers.py:152:10 - error: Object of type "DockerClient" cannot be used with "with" because it does not implement __exit__ (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/prefect/src/integrations/prefect-docker/prefect_docker/containers.py:152:10 - error: Object of type "DockerClient" cannot be used with "with" because it does not correctly implement __exit__
+ Attribute "__exit__" is unknown (reportGeneralTypeIssues)
... (truncated 199 lines) ...``` |
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.
… return result of
__aexit__
is awaitable and improved error messages for the case where__enter__
, etc. are present but have incorrect signatures. This addresses #9694.