Skip to content

docs: document SupportsInt conversion behavior for query params#1638

Open
toroleapinc wants to merge 1 commit intoaio-libs:masterfrom
toroleapinc:docs/issue-1458-document-supportsint-conversion
Open

docs: document SupportsInt conversion behavior for query params#1638
toroleapinc wants to merge 1 commit intoaio-libs:masterfrom
toroleapinc:docs/issue-1458-document-supportsint-conversion

Conversation

@toroleapinc
Copy link

Summary

Documents the behavior where objects implementing SupportsInt (such as uuid.UUID) are converted to int when used as query parameter values.

Closes #1458

Changes

  • Added a warning box to the with_query documentation explaining the SupportsIntint conversion behavior
  • Included a concrete uuid.UUID example showing the correct usage pattern (explicit str() conversion)
  • Enhanced the query_var() docstring to note this behavior
  • Added towncrier changelog fragment

Context

As discussed in #1458, the maintainers decided that the current behavior (converting SupportsInt objects to int) should be kept, but documented clearly so users know to explicitly convert types like uuid.UUID to strings.

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]>
@psf-chronographer psf-chronographer bot added the bot:chronographer:provided There is a change note present in this PR label Mar 3, 2026
@codspeed-hq
Copy link

codspeed-hq bot commented Mar 3, 2026

Merging this PR will not alter performance

✅ 99 untouched benchmarks


Comparing toroleapinc:docs/issue-1458-document-supportsint-conversion (6d34512) with master (dc871b6)

Open in CodSpeed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot:chronographer:provided There is a change note present in this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Convert an uuid.UUID variable into int when pass it in params

1 participant