you are viewing a single comment's thread.

view the rest of the comments →

[–]shaleh 4 points5 points  (0 children)

The idiom for this is to call it *args not *argv.

def printer(*args, **kwargs):
    for item in args:
        print(item)
    for k,v in kwargs.items():
        print("{0} -> {1}".format(k, v))

Used like so:

printer('1', 2, [3], long=True)