Is this an instance of namedtuple/NamedTuple? From: https://stackoverflow.com/a/62692640 Args: obj (object): An object. Returns: bool: True if namedtuple/NamedTuple else False.
(obj: object)
| 134 | |
| 135 | |
| 136 | def isinstance_namedtuple(obj: object) -> bool: |
| 137 | """ |
| 138 | Is this an instance of namedtuple/NamedTuple? |
| 139 | From: https://stackoverflow.com/a/62692640 |
| 140 | |
| 141 | Args: |
| 142 | obj (object): An object. |
| 143 | |
| 144 | Returns: |
| 145 | bool: True if namedtuple/NamedTuple else False. |
| 146 | """ |
| 147 | return isinstance(obj, tuple) and hasattr(obj, '_asdict') and hasattr(obj, '_fields') |
| 148 | |
| 149 | |
| 150 | def is_zero_param(parameter): |
no outgoing calls
no test coverage detected