Checks if all attributes (not on skiplist) are None
(obj, skiplist: Optional[List[str]] = None)
| 3293 | return obj |
| 3294 | |
| 3295 | def is_empty_instance(obj, skiplist: Optional[List[str]] = None): |
| 3296 | """ Checks if all attributes (not on skiplist) are None """ |
| 3297 | if not obj: return True |
| 3298 | if not isinstance(skiplist, list): skiplist= [] |
| 3299 | for attr, value in vars(obj).items(): |
| 3300 | if not (attr in skiplist or value is None): |
| 3301 | return False |
| 3302 | return True |
| 3303 | |
| 3304 | def is_blank_instance(obj, skiplist: Optional[List[str]] = None): |
| 3305 | """ Checks if all attributes (not on skiplist) are None or empty """ |