Create a shallow copy of a type. This can be used to mutate the copy with truthiness information. Classes compiled with mypyc don't support copy.copy(), so we need a custom implementation.
(t: ProperType)
| 32 | |
| 33 | |
| 34 | def copy_type(t: ProperType) -> ProperType: |
| 35 | """Create a shallow copy of a type. |
| 36 | |
| 37 | This can be used to mutate the copy with truthiness information. |
| 38 | |
| 39 | Classes compiled with mypyc don't support copy.copy(), so we need |
| 40 | a custom implementation. |
| 41 | """ |
| 42 | return t.accept(TypeShallowCopier()) |
| 43 | |
| 44 | |
| 45 | class TypeShallowCopier(TypeVisitor[ProperType]): |
no test coverage detected
searching dependent graphs…