Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Parsing "dict" arguments for Invoke
def parse_extra_args(extra_args):
"""Expects `extra_args` to be in the format of: key=val,key2=val,key3=val"""
if extra_args is None:
return {}
parts = extra_args.split(',')
return {k: v for k, v in (i.split('=') for i in parts)}
def foo(extra_args=None):
args = parse_extra_args(extra_args)
# do stuff with args
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.