def tag(*tags):
    '''
    Constructs a decorator that tags a function with specified
    strings (@tags). The tags on the decorated function are
    available via fn.tags
    '''
    def dfn(fn):
        _tags = getattr(fn, 'tags', set())
        _tags.update(tags)
        fn.tags = _tags
        return fn
    return dfn
def tag ( * tags ) : def dfn ( fn ) : _tags = getattr ( fn , 'tags' , set ( ) ) _tags . update ( tags ) fn . tags = _tags return fn return dfn
Constructs a decorator that tags a function with specified
    strings (@tags). The tags on the decorated function are
    available via fn.tags