def clone(rolecls, subj):
    """
    Returns a new subject instance with role applied. Both instances refer to
    the same instance dict.

    >>> class Person(object):
    ...     def __init__(self, name): self.name = name
    ...     def am(self): print self.name, 'is'
    >>> class Biker(object):
    ...     __metaclass__ = RoleType
    ...     def bike(self): print self.name, 'bikes'
    ...
    >>> person = Person('Joe')
    >>> biker = Biker(person, method=clone)
    >>> biker # doctest: +ELLIPSIS
    <roles.role.Person+Biker object at 0x...>
    >>> person # doctest: +ELLIPSIS
    <roles.role.Person object at 0x...>
    >>> person is biker
    False
    >>> person.__dict__ is biker.__dict__
    True
    >>> biker.bike()
    Joe bikes

    Note that ``clone`` has a serious downside: since only the instance dict is
    cloned, everything defined in the class (properties, methods) are not
    accessible by the role.
    """
    newsubj = rolecls.__new__(rolecls)
    newsubj.__dict__ = subj.__dict__
    return newsubj
