Skip to content
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
merged 1 commit into from
Jan 13, 2025

Conversation

erictraut
Copy link
Collaborator

… 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.

… 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.
Copy link
Contributor

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) ...```

@erictraut erictraut merged commit 14b3c70 into main Jan 13, 2025
17 checks passed
@erictraut erictraut deleted the issue-9694 branch January 13, 2025 22:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant