fdutils/classes.py
def mixin(instance, mixin_class):
    """  Dynamically mixes a mixin class into an object
    Args:
        instance:  current object instance
        mixin_class:  the class whose functions and attributes we want to mix into instance

    Returns:

    """
    import types

    for name in mixin_class.__dict__:
        if name.startswith('__') and name.endswith('__'):
            continue
        elif isinstance(mixin_class.__dict__[name], types.FunctionType):
            # bind function to instance
            instance.__dict__[name] = mixin_class.__dict__[name].__get__(instance)
        else:
            instance.__dict__[name] = mixin_class.__dict__[name]
  Dynamically mixes a mixin class into an object
    Args:
        instance:  current object instance
        mixin_class:  the class whose functions and attributes we want to mix into instance

    Returns:

    
Dynamically mixes a mixin class into an object
Dynamically mixes a mixin class into an object
def mixin(instance, mixin_class):
    import types
    for name in mixin_class.__dict__:
        if name.startswith('__') and name.endswith('__'):
            continue
        elif isinstance(mixin_class.__dict__[name], types.FunctionType):
            instance.__dict__[name] = mixin_class.__dict__[name].__get__(instance)
        else:
            instance.__dict__[name] = mixin_class.__dict__[name]
def mixin ( instance , mixin_class ) : import types for name in mixin_class . __dict__ : if name . startswith ( '__' ) and name . endswith ( '__' ) : continue elif isinstance ( mixin_class . __dict__ [ name ] , types . FunctionType ) : instance . __dict__ [ name ] = mixin_class . __dict__ [ name ] . __get__ ( instance ) else : instance . __dict__ [ name ] = mixin_class . __dict__ [ name ]
Dynamically mixes a mixin class into an object
Dynamically mixes a mixin class into an object
"""  Dynamically mixes a mixin class into an object
    Args:
        instance:  current object instance
        mixin_class:  the class whose functions and attributes we want to mix into instance

    Returns:

    """ # bind function to instance
None
instance
current object instance
current object instance
mixin_class
the class whose functions and attributes we want to mix into instance
the class whose functions and attributes we want to mix into instance