(obj, notifyDead: DeadRefObserver = None)
return createRef(obj, notifyDead)
Get a weak reference to obj. If obj is a bound method, a WeakMethod
    object, that behaves like a WeakRef, is returned; if it is
    anything else a WeakRef is returned. If obj is an unbound method,
    a ValueError will be raised.
Get a weak reference to obj. If obj is a bound method, a WeakMethod
    object, that behaves like a WeakRef, is returned; if it is
    anything else a WeakRef is returned. If obj is an unbound method,
    a ValueError will be raised.
Get a weak reference to obj . If obj is a bound method a WeakMethod object that behaves like a WeakRef is returned ; if it is anything else a WeakRef is returned . If obj is an unbound method a ValueError will be raised .
def getWeakRef(obj, notifyDead: DeadRefObserver = None):
    """
    Get a weak reference to obj. If obj is a bound method, a WeakMethod
    object, that behaves like a WeakRef, is returned; if it is
    anything else a WeakRef is returned. If obj is an unbound method,
    a ValueError will be raised.
    """
    if ismethod(obj):
        createRef = WeakMethod
    else:
        createRef = WeakRef

    return createRef(obj, notifyDead)
def getWeakRef ( obj , notifyDead : DeadRefObserver = None ) : if ismethod ( obj ) : createRef = WeakMethod else : createRef = WeakRef return createRef ( obj , notifyDead )