Skip to content

Add overloads for URL parameter functions authlib.common.urls#15786

Merged
srittau merged 3 commits into
python:mainfrom
mrhx01:fix-authlib-common-urls
May 13, 2026
Merged

Add overloads for URL parameter functions authlib.common.urls#15786
srittau merged 3 commits into
python:mainfrom
mrhx01:fix-authlib-common-urls

Conversation

@mrhx01
Copy link
Copy Markdown
Contributor

@mrhx01 mrhx01 commented May 13, 2026

params_to_qs:

Reason:

  1. The implementation accepts dict[str, str] (via params.items()), so the type hint should reflect this.

extract_params:

Reason:

  1. The function accepts None and returns None
  2. str input (query string) is also supported and may return None for invalid input

@mrhx01 mrhx01 changed the title Add overloads for URL parameter functions Add overloads for URL parameter functions authlib.common.urls May 13, 2026
@github-actions

This comment has been minimized.

Comment thread stubs/Authlib/authlib/common/urls.pyi Outdated
Comment thread stubs/Authlib/authlib/common/urls.pyi Outdated
Co-authored-by: Sebastian Rittau <sebastian.rittau@zfutura.de>
@github-actions

This comment has been minimized.

Co-authored-by: Sebastian Rittau <sebastian.rittau@zfutura.de>
@github-actions
Copy link
Copy Markdown
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

Copy link
Copy Markdown
Contributor Author

@mrhx01 mrhx01 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the review! I've applied both suggestions:

  1. Changed add_params_to_qs to use union instead of overload
  2. Added tuple[tuple[str, str], ...] to extract_params overload

@mrhx01 mrhx01 requested a review from srittau May 13, 2026 15:11
Copy link
Copy Markdown
Collaborator

@srittau srittau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@srittau srittau merged commit d3889ed into python:main May 13, 2026
44 checks passed
@mrhx01 mrhx01 deleted the fix-authlib-common-urls branch May 13, 2026 18:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants