Class that mimics a C function in order to provide parseable docstrings.
| 186 | |
| 187 | |
| 188 | class CFunctionStub: |
| 189 | """ |
| 190 | Class that mimics a C function in order to provide parseable docstrings. |
| 191 | """ |
| 192 | |
| 193 | def __init__(self, name: str, doc: str, is_abstract: bool = False) -> None: |
| 194 | self.__name__ = name |
| 195 | self.__doc__ = doc |
| 196 | self.__abstractmethod__ = is_abstract |
| 197 | |
| 198 | @classmethod |
| 199 | def _from_sig(cls, sig: FunctionSig, is_abstract: bool = False) -> CFunctionStub: |
| 200 | return CFunctionStub(sig.name, sig.format_sig()[:-4], is_abstract) |
| 201 | |
| 202 | @classmethod |
| 203 | def _from_sigs(cls, sigs: list[FunctionSig], is_abstract: bool = False) -> CFunctionStub: |
| 204 | return CFunctionStub( |
| 205 | sigs[0].name, "\n".join(sig.format_sig()[:-4] for sig in sigs), is_abstract |
| 206 | ) |
| 207 | |
| 208 | def __get__(self) -> None: # noqa: PLE0302 |
| 209 | """ |
| 210 | This exists to make this object look like a method descriptor and thus |
| 211 | return true for CStubGenerator.ismethod() |
| 212 | """ |
| 213 | pass |
| 214 | |
| 215 | |
| 216 | _Missing = enum.Enum("_Missing", "VALUE") |
no outgoing calls
no test coverage detected
searching dependent graphs…