Remix.run Logo
maleldil 5 days ago

> but pyright will not (because it infers the types of unannotated collections as having Any)

This is incorrect. pyright will infer the type of x as list[Unknown].

hauntsaninja 5 days ago | parent [-]

Unknown has the exact same type system semantics as Any.

Unknown is a pyright specific term for inferred Any that is used as the basis for enabling additional diagnostics prohibiting gradual typing.

Notably, this is quite different from TypeScript’s unknown, which is type safe.

ErikBjare 4 days ago | parent [-]

This was confusing me, thanks.