It looks like issue #3054 was not completely fixed. Namely, in some scenarios named tuples
in import cycles result in Invalid type. For example, checking this file
results in
typeshed/stdlib/3/os/__init__.pyi:331: error: Invalid type "posix.uname_result"
typeshed/stdlib/3/os/__init__.pyi:599: error: Invalid type "posix.times_result"
typeshed/stdlib/3/os/__init__.pyi:605: error: Invalid type "posix.waitid_result"
typeshed/stdlib/3/os/__init__.pyi:622: error: Invalid type "posix.sched_param"
typeshed/stdlib/3/os/__init__.pyi:624: error: Invalid type "posix.sched_param"
typeshed/stdlib/3/os/__init__.pyi:625: error: Invalid type "posix.sched_param"
Note that the above "invalid" types are all named tuples and there is an import cycle os <-> posix. Interestingly, import os and from os import * both typecheck cleanly.
I haven't yet tried to find a simple repro (not involving typeshed).
It looks like issue #3054 was not completely fixed. Namely, in some scenarios named tuples
in import cycles result in
Invalid type. For example, checking this fileresults in
Note that the above "invalid" types are all named tuples and there is an import cycle
os <-> posix. Interestingly,import osandfrom os import *both typecheck cleanly.I haven't yet tried to find a simple repro (not involving typeshed).