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)
| 143 | |
| 144 | |
| 145 | def isinstance_namedtuple(obj: object) -> bool: |
| 146 | """ |
| 147 | Is this an instance of namedtuple/NamedTuple? |
| 148 | From: https://stackoverflow.com/a/62692640 |
| 149 | |
| 150 | Args: |
| 151 | obj (object): An object. |
| 152 | |
| 153 | Returns: |
| 154 | bool: True if namedtuple/NamedTuple else False. |
| 155 | """ |
| 156 | return isinstance(obj, tuple) and hasattr(obj, '_asdict') and hasattr(obj, '_fields') |
| 157 | |
| 158 | |
| 159 | def is_zero_param(parameter): |
no outgoing calls
no test coverage detected