The Python type system supports the type[Any] type as a special case of the type[...] special form. This is a gradual type representing some unknown class and all of its subclasses.
Once we have fixed #14544, we should also support type[Any]. This will require updating our representation of SubclassOfType to an enum, so it can store either a Class or just represent type[Any]. This will also require checking each place we handle Type::SubclassOf and updating it to handle the gradual variant correctly.
We should also infer type[Any] from an annotation that just uses bare type, e.g. x: type = ....
The Python type system supports the
type[Any]type as a special case of thetype[...]special form. This is a gradual type representing some unknown class and all of its subclasses.Once we have fixed #14544, we should also support
type[Any]. This will require updating our representation ofSubclassOfTypeto an enum, so it can store either aClassor just representtype[Any]. This will also require checking each place we handleType::SubclassOfand updating it to handle the gradual variant correctly.We should also infer
type[Any]from an annotation that just uses baretype, e.g.x: type = ....