Skip to content

[httpretty] match_https_hostname() and match_http_address() return URIMatcher | None - #16880

Open
Primeteumm wants to merge 1 commit into
python:mainfrom
Primeteumm:httpretty-match-returns-matcher
Open

Primeteumm wants to merge 1 commit into
python:mainfrom
Primeteumm:httpretty-match-returns-matcher

Conversation

@Primeteumm

Copy link
Copy Markdown
Contributor

Both methods return the matching URIMatcher or None, not a bool: https://github.com/gabrielfalcao/HTTPretty/blob/1.1.4/httpretty/core.py#L1422-L1484

Agent used: Claude Code (Claude Opus 5.5).

…IMatcher | None

Both classmethods were annotated as returning bool, but in httpretty
1.1.4 they iterate over `httpretty._entries` (whose keys are the
URIMatcher instances created in register_uri()) and `return matcher`
on a match, otherwise `return None`. Their docstrings also say they
return a matcher or None, and httpretty's own callers check
`if matcher is None`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

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

This branch has not been deployed

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

Labels

None yet

1 participant