Return the last component of the type name of an object. If obj is None, return 'nil'. For example, if obj is 1, return 'int'.
(obj: object)
| 112 | |
| 113 | |
| 114 | def short_type(obj: object) -> str: |
| 115 | """Return the last component of the type name of an object. |
| 116 | |
| 117 | If obj is None, return 'nil'. For example, if obj is 1, return 'int'. |
| 118 | """ |
| 119 | if obj is None: |
| 120 | return "nil" |
| 121 | t = str(type(obj)) |
| 122 | return t.split(".")[-1].rstrip("'>") |
| 123 | |
| 124 | |
| 125 | def find_python_encoding(text: bytes) -> tuple[str, int]: |
searching dependent graphs…