Returns whether name is a dunder name. Args: exclude_special: Whether to return False for a couple special dunder methods.
(name: str, exclude_special: bool = False)
| 64 | |
| 65 | |
| 66 | def is_dunder(name: str, exclude_special: bool = False) -> bool: |
| 67 | """Returns whether name is a dunder name. |
| 68 | |
| 69 | Args: |
| 70 | exclude_special: Whether to return False for a couple special dunder methods. |
| 71 | |
| 72 | """ |
| 73 | if exclude_special and name in SPECIAL_DUNDERS: |
| 74 | return False |
| 75 | return name.startswith("__") and name.endswith("__") |
| 76 | |
| 77 | |
| 78 | def is_sunder(name: str) -> bool: |
searching dependent graphs…