-
Notifications
You must be signed in to change notification settings - Fork 174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue #55 Lists in kwargs #63
Merged
jessemcbride
merged 10 commits into
ucfopen:develop
from
Thetwam:issue/55-lists-in-kwargs
Aug 30, 2017
Merged
Issue #55 Lists in kwargs #63
jessemcbride
merged 10 commits into
ucfopen:develop
from
Thetwam:issue/55-lists-in-kwargs
Aug 30, 2017
Conversation
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
…eps all the kwargs in the list of 2-tuple format. Updated requester to take in any additional kwargs and format them the same way.
…rather than dict.
…on exact positioning. In all versions of Python prior to 3.6, kwargs have no order so we can't rely on position. This is fine for the existing tests, but future tests with lists will need to check relative order.
…come in any order, but the elements of the first dict must come before any of the elements of the second dict
…s. Renamed recursive function to flatten_kwarg. Added break to files handler to slightly boost performance.
jessemcbride
approved these changes
Aug 30, 2017
This was referenced Oct 4, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds official support for lists in kwargs. Resolves #55.
Simple lists
When a parameter that contains an empty pair of square brackets (
[]
) needs to be passed, the arguments can be sent as a list.For example, to get pass following parameter to the
list_calendar_events
method:Just pass
context_codes
as a list:This allows multiple values to be passed easily at once:
Which would pass this to Canvas:
Nested Lists and Dicts
We have had support for nested dictionaries for a while, but that treatment now applies to lists. Lists and dicts can be mixed without any issues.
For example, to pass these arguments to the method to create a new grading standard:1
Just do this!
1 Note, this method is not yet implemented but the code in this PR allows it to be created with relative ease.