def get_bound_method_weakref(target, onDelete):
 if hasattr(target, '__get__'):
  return BoundMethodWeakref(target=target, onDelete=onDelete)
 else:
  return BoundNonDescriptorMethodWeakref(target=target, onDelete=onDelete)

def get_bound_method_weakref ( target , onDelete ) : if hasattr ( target , '__get__' ) : return BoundMethodWeakref ( target = target , onDelete = onDelete ) else : return BoundNonDescriptorMethodWeakref ( target = target , onDelete = onDelete )
instantiates the appropiate boundmethodweakref .