Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- small_dict = {"a":"1"}
- full_dict = {"a":"1", "b":"test", "c":["junk"]}
- template = {"a":int, "c":list}
- def check(incoming_args, template):
- res = {}
- for key in template:
- if key in incoming_args:
- res[key] = template[key](incoming_args[key])
- return res
- print check(small_dict, template)
- print check(full_dict, template)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement