def calculate_key(cls, target):
    """Calculate the reference key for this reference.

        Currently this is a two-tuple of the id()'s of the target
        object and the target function respectively.
        """
    try:
        return id(target.im_self), id(target.im_func)
    except AttributeError:
        return id(target.__self__), id(target.__func__)
