Created
September 4, 2018 11:42
-
-
Save mrchrisadams/91d2839b0104267e52aff197de1d2f73 to your computer and use it in GitHub Desktop.
How do I pass keywords in to this query() function in python?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set_o_tuples = [ | |
("streetaddress", "burdon") | |
("area", "bungo"), | |
("region", "bingo"), | |
("some_other_key", "bango"), | |
]) | |
for key, val in set_o_tuples: | |
# I want to run code like this, but keept it DRYer than | |
# literally typing the the code below | |
# some_obj.query(streetaddress="burdon") | |
# some_obj.query(area="bungo") | |
# some_obj.query(region="bingo") | |
# some_obj.query(some_other_key="bango") | |
some_obj.query(key=val) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment