Skip to content

Conversation

@leonardt
Copy link

The current API expects a Pattern type, but the internal code expects a str (hence it calls re.compile). It turns out calling re.compile on a Pattern works. The documentation shows passing in a str, which seems like a convenient API. Adding the logic to support Pattern | str allows the match API to work properly with the str interface while maintaining backwards compatibility with any existing code that passes an explicitly compiled Pattern

@leonardt leonardt requested a review from mikeurbach July 24, 2025 18:12
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