module documentation
Match pytd types against each other. "Matching" x against y means roughly: If we have a function f(param: y) and a type x, would we be able to pass (an instance of) x to f. (I.e., "execute f(x)"). So for example, str would "match" against basestring, and list[int] would match against list[Number]. This is used for converting structural types to nominal types during type inference, but could also be used when merging pytd files, to match existing signatures against new inference results.
Class |
|
A type that doesn't allow sub- or superclasses to match. |
Class |
|
Class for matching types against other types. |
Function | get |
Compute a class->subclasses mapping. |
Function | is |
Return True if this is an ~unknown. |
Variable | log |
Undocumented |
Type Alias | _ |
Undocumented |
Type Alias | _ |
Undocumented |
Compute a class->subclasses mapping. Args: asts: A list of ASTs. Returns: A dictionary, mapping instances of pytd.Type (types) to lists of pytd.Class (the derived classes).