docs: document SupportsInt conversion behavior for query params#1638
Open
toroleapinc wants to merge 1 commit intoaio-libs:masterfrom
Open
docs: document SupportsInt conversion behavior for query params#1638toroleapinc wants to merge 1 commit intoaio-libs:masterfrom
toroleapinc wants to merge 1 commit intoaio-libs:masterfrom
Conversation
Document that objects implementing SupportsInt (such as uuid.UUID) are converted to int when used as query parameter values. This can lead to unexpected results, e.g. a UUID being represented as a large integer rather than its standard string form. Added a warning to the with_query documentation with a concrete uuid.UUID example showing the correct usage pattern. Closes aio-libs#1458 Signed-off-by: edvatar <[email protected]>
This file contains hidden or 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
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.
Summary
Documents the behavior where objects implementing
SupportsInt(such asuuid.UUID) are converted tointwhen used as query parameter values.Closes #1458
Changes
with_querydocumentation explaining theSupportsInt→intconversion behavioruuid.UUIDexample showing the correct usage pattern (explicitstr()conversion)query_var()docstring to note this behaviorContext
As discussed in #1458, the maintainers decided that the current behavior (converting
SupportsIntobjects toint) should be kept, but documented clearly so users know to explicitly convert types likeuuid.UUIDto strings.