def attrgetter(name):
    """Get attribute 'name' from object and return
        a string representation of it."""
    getname = operator.attrgetter(name)

    def str_getattr(self, obj=None):
        obj = self if obj is None else obj
        return str(getname(obj))

    return str_getattr
Get attribute 'name' from object and return
        a string representation of it.
recipes/Python/576671_Parse_call_functiPy26_Py27_/recipe-576671.py