Create a unique id for a function. This creates an id that is unique for any given function definition, so that it can be used as a dictionary key. This is usually the fullname of the function, but this is different in that it handles the case where the function is named '_', in which c
(name: str, fullname: str, line: int)
| 122 | |
| 123 | |
| 124 | def get_id_from_name(name: str, fullname: str, line: int) -> str: |
| 125 | """Create a unique id for a function. |
| 126 | |
| 127 | This creates an id that is unique for any given function definition, so that it can be used as |
| 128 | a dictionary key. This is usually the fullname of the function, but this is different in that |
| 129 | it handles the case where the function is named '_', in which case multiple different functions |
| 130 | could have the same name.""" |
| 131 | if unnamed_function(name): |
| 132 | return f"{fullname}.{line}" |
| 133 | else: |
| 134 | return fullname |
| 135 | |
| 136 | |
| 137 | def short_id_from_name(func_name: str, shortname: str, line: int | None) -> str: |
no test coverage detected
searching dependent graphs…