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
As of the 0.62.0 release, when type-checking a Hypothesis-using project with Mypy, at least the pretty vendored module raises (valid) type errors:
…/hypothesis/vendor/pretty.py:501: error: Module has no attribute "InstanceType"
…/hypothesis/vendor/pretty.py:503: error: Incompatible types in assignment (expression has type "Tuple[Callable[[object], str]]", variable has type "Tuple[Callable[[object], str], Any]")
…/hypothesis/vendor/pretty.py:764: error: Cannot assign to a type
…/hypothesis/vendor/pretty.py:764: error: Cannot assign multiple types to name "_exception_base" without an explicit "Type[...]" annotation
…/hypothesis/vendor/pretty.py:791: error: Module has no attribute "DictProxyType"
…/hypothesis/vendor/pretty.py:792: error: Module has no attribute "DictProxyType"
…/hypothesis/vendor/pretty.py:794: error: Module has no attribute "ClassType"
…/hypothesis/vendor/pretty.py:795: error: Module has no attribute "SliceType"
…/hypothesis/vendor/pretty.py:800: error: Name 'xrange' is not defined
…/hypothesis/vendor/pretty.py:801: error: Name 'long' is not defined
…/hypothesis/vendor/pretty.py:802: error: Name 'unicode' is not defined
…/hypothesis/vendor/pretty.py:808: error: Need type annotation for '_deferred_type_pprinters'
(The errors are things like Python 2 compatibility code that isn't valid under Python 3.)
I'm guessing this is due to the py.typed marker, which counts everything under the hypothesis
package to be type-checked.
The workaround is to explicitly ignore the module's errors in the project's mypy.ini:
However, projects should not be expected to do this in general: the fix should be to explicitly annotate the code in question (or the whole module, pending python/mypy#626) with # type: ignore.
The text was updated successfully, but these errors were encountered:
As of the 0.62.0 release, when type-checking a Hypothesis-using project with Mypy, at least the
pretty
vendored module raises (valid) type errors:(The errors are things like Python 2 compatibility code that isn't valid under Python 3.)
I'm guessing this is due to the
py.typed
marker, which counts everything under thehypothesis
package to be type-checked.
The workaround is to explicitly ignore the module's errors in the project's
mypy.ini
:However, projects should not be expected to do this in general: the fix should be to explicitly annotate the code in question (or the whole module, pending python/mypy#626) with
# type: ignore
.The text was updated successfully, but these errors were encountered: