class MergeTypeParameters(TypeParameterScope): (source)
Remove all function type parameters in a union with a class type param. For example, this will change class A(typing.Generic(T)): def append(self, Union[T, T2]) -> T2 to class A(typing.Generic(T)): def append(self, T) -> T . Use this visitor after using AbsorbMutableParameters. As another example, the combination of AbsorbMutableParameters and MergeTypeParameters transforms class list(typing.Generic(T)): def append(self, v: T2) -> NoneType: self = Union[T, T2] to class list(typing.Generic(T')): def append(self, V:T') -> NoneType by creating a *new* template variable T' that propagates the mutations to the outermost level (in this example, T' = Union[T, T2])
Method | __init__ |
Undocumented |
Method |
|
Undocumented |
Method |
|
Undocumented |
Method |
|
Undocumented |
Method |
|
Undocumented |
Instance Variable | type |
Undocumented |
Method | _ |
Gets all type parameters that are in a union with the passed one. |
Method | _ |
Appends all items to l1 that are not in l2. |
Method | _ |
Potentially replace a function type param with a class type param. |
Inherited from TypeParameterScope
:
Method |
|
Undocumented |
Method |
|
Undocumented |
Method |
|
Undocumented |
Method |
|
Undocumented |
Instance Variable | type |
Undocumented |
Inherited from Visitor
(via TypeParameterScope
):
Method |
|
Undocumented |
Method |
|
Undocumented |
Method |
|
Undocumented |
Class Variable | old |
Undocumented |
Class Variable | unchecked |
Undocumented |
Class Variable | visits |
Undocumented |
Instance Variable | enter |
Undocumented |
Instance Variable | leave |
Undocumented |
Instance Variable | visit |
Undocumented |
Instance Variable | visit |
Undocumented |
Class Variable | _visitor |
Undocumented |