Construct the type 'builtins.object' from an instance type.
(instance: Instance)
| 868 | |
| 869 | |
| 870 | def object_from_instance(instance: Instance) -> Instance: |
| 871 | """Construct the type 'builtins.object' from an instance type.""" |
| 872 | # Use the fact that 'object' is always the last class in the mro. |
| 873 | res = Instance(instance.type.mro[-1], []) |
| 874 | return res |
| 875 | |
| 876 | |
| 877 | def object_or_any_from_type(typ: ProperType) -> ProperType: |
no test coverage detected
searching dependent graphs…