UniCoreFW

is_weak_set()

Check if obj is a WeakSet (WeakSet in Python).

Implementation

Args: obj: The object to check Returns: True if obj is a WeakSet, False otherwise

Example

from weakref import WeakSet is_weak_set(WeakSet())

Expected output: True

Source Code

def is_weak_set(obj: Any) -> bool: from weakref import WeakSet return isinstance(obj, WeakSet)