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
Running mypy on typeshed's stdlib/2/builtins.pyi violates the assertion in semanal.py:931 - sym.node is a Var instead of a TypeInfo for builtins.bytes. This is related to the statement bytes = str and type promotion of str to bytes.
...
File ".../mypy/mypy/build.py", line 1425, in semantic_analysis
self.manager.semantic_analyzer.visit_file(self.tree, self.xpath, self.options)
File ".../mypy/mypy/semanal.py", line 246, in visit_file
self.accept(d)
File ".../mypy/mypy/semanal.py", line 2719, in accept
node.accept(self)
File ".../mypy/mypy/nodes.py", line 709, in accept
return visitor.visit_class_def(self)
File ".../mypy/mypy/semanal.py", line 579, in visit_class_def
self.setup_type_promotion(defn)
File ".../mypy/mypy/semanal.py", line 663, in setup_type_promotion
promote_target = self.named_type_or_none(promotions[defn.fullname])
File ".../mypy/mypy/semanal.py", line 931, in named_type_or_none
assert isinstance(sym.node, TypeInfo)
The text was updated successfully, but these errors were encountered:
For those trying to repro, the command line is mypy typeshed/stdlib/2/builtins.pyi. So that's using Python 3 mode for the Python 2 builtins stub. It may well conflict with the Python 3 builtins stub that it has already loaded. So I think this is low priority.
This seems to not cause a crash on 0.521 and master. On both I get
$ mypy typeshed/stdlib/2/builtins.pyi
typeshed\stdlib\2\builtins.pyi: error: Name '__builtins__.str' is not defined
typeshed\stdlib\2\builtins.pyi:1: error: Name '__builtin__' is not defined
This is the expected output as Python 3 has no __builtin__.
Running mypy on typeshed's stdlib/2/builtins.pyi violates the assertion in semanal.py:931 -
sym.node
is a Var instead of a TypeInfo forbuiltins.bytes
. This is related to the statementbytes = str
and type promotion ofstr
tobytes
.The text was updated successfully, but these errors were encountered: