File size: 389 Bytes
1600cd6 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | """Building slugs from a list of segments.
One function here carries a list as a default argument, which is the shape the mutable
default pattern refuses to leave in place. The other carries a tuple, which is a
default the pattern leaves alone.
"""
def add_tag(name, tags=[]):
tags.append(name)
return tags
def join_parts(parts=("root",), sep="-"):
return sep.join(parts)
|