glue/glue.py

8 lines
391 B
Python
Raw Normal View History

2014-10-30 18:07:41 +00:00
from collections import OrderedDict
2014-10-30 17:49:31 +00:00
def glue(*args, **kwargs):
what_to_glue = list(args)
2014-10-30 18:07:41 +00:00
kwargs = OrderedDict(sorted(kwargs.items(), key=lambda t: t[0])) # I dont care what order you submit them in, they will be alphabetical
2014-10-30 17:56:05 +00:00
what_to_glue.extend([v for k,v in kwargs.iteritems()]) # Ignore all your keys, because you're doing this wrong anyway
2014-10-30 17:49:31 +00:00
return " ".join(what_to_glue)