def properties_operator(cls, name):
    """Wraps a container operator to ensure container class is maintained"""

    def wrapper(self, *args, **kwargs):
        """Perform operation and cast to container class"""
        output = getattr(super(cls, self), name)(*args, **kwargs)
        return cls(output)

    wrapped = getattr(cls, name)
    wrapper.__name__ = wrapped.__name__
    wrapper.__doc__ = wrapped.__doc__
    return wrapper
def properties_operator ( cls , name ) : def wrapper ( self , * args , ** kwargs ) : output = getattr ( super ( cls , self ) , name ) ( * args , ** kwargs ) return cls ( output ) wrapped = getattr ( cls , name ) wrapper . __name__ = wrapped . __name__ wrapper . __doc__ = wrapped . __doc__ return wrapper
Wraps a container operator to ensure container class is maintained