You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Issue #55 pointed out that canvasapi 0.6.0 made it awkward to pass a list as a parameter value. Pull request #63 fixed this, with friendly support for both list and tuple from canvasapi 0.7.0 forward. Yay! However, list and tuple are just two of the many Pythonic ways to collect multiple values. It would be nice if canvasapi provided the same parameter-marshaling support for any parameter value that is actually an iterable collection of multiple values: set, generators, iterable objects returned by zip and ichain, etc. Note, however, that strings are a special case: str is iterable, but should be treated as a single value, not as a sequence of isolated characters.
An example of something that works in canvasapi 0.7.0:
Some examples of things that do not work in canvasapi 0.7.0:
# multiple values as a setassignment_ids=set(...)
course.list_multiple_submissions(student_ids='all', assignment_ids=assignment_ids)
# multiple values as an iterator over dictionary valuesmapping= {'a': 1, 'b': 2, 'c': 3}
course.list_multiple_submissions(student_ids='all', assignment_ids=mapping.values())
# multiple values as a generator expressioncourse.list_multiple_submissions(student_ids='all', assignment_ids=(assn.idforassnin ...))
Spoiler alert: I am already developing code to implement this feature. Expect a pull request soonish.
The text was updated successfully, but these errors were encountered:
Issue #55 pointed out that
canvasapi
0.6.0 made it awkward to pass alist
as a parameter value. Pull request #63 fixed this, with friendly support for bothlist
andtuple
fromcanvasapi
0.7.0 forward. Yay! However,list
andtuple
are just two of the many Pythonic ways to collect multiple values. It would be nice ifcanvasapi
provided the same parameter-marshaling support for any parameter value that is actually an iterable collection of multiple values:set
, generators, iterable objects returned byzip
andichain
, etc. Note, however, that strings are a special case:str
is iterable, but should be treated as a single value, not as a sequence of isolated characters.An example of something that works in
canvasapi
0.7.0:Some examples of things that do not work in
canvasapi
0.7.0:Spoiler alert: I am already developing code to implement this feature. Expect a pull request soonish.
The text was updated successfully, but these errors were encountered: