Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Support compiled patterns inprotected_namespaces#10522

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
sydney-runkle merged 11 commits intomainfromsupport-re-for-protected-ns
Oct 2, 2024

Conversation

sydney-runkle
Copy link
Contributor

@sydney-runklesydney-runkle commentedSep 30, 2024
edited
Loading

ConfigDict.protected_namespaces now supports matching on compiled patterns.

Whereas we used to only support prefix check forstr type protected namespaces, this now expands the customizability of a protected namespace significantly.

@cloudflare-workers-and-pagesCloudflare Workers and Pages
Copy link

cloudflare-workers-and-pagesbot commentedSep 30, 2024
edited
Loading

Deploying pydantic-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit:35804ff
Status: ✅  Deploy successful!
Preview URL:https://d4c38ffd.pydantic-docs.pages.dev
Branch Preview URL:https://support-re-for-protected-ns.pydantic-docs.pages.dev

View logs

@codspeed-hqCodSpeed HQ
Copy link

codspeed-hqbot commentedSep 30, 2024
edited
Loading

CodSpeed Performance Report

Merging#10522 willnot alter performance

Comparingsupport-re-for-protected-ns (35804ff) withmain (9de0648)

Summary

✅ 38 untouched benchmarks

@github-actionsGitHub Actions
Copy link
Contributor

github-actionsbot commentedOct 1, 2024
edited
Loading

Coverage report

This PR does not seem to contain any modification to coverable code.

if ann_name.startswith(protected_namespace):
ns_violation: bool = False
if isinstance(protected_namespace, Pattern):
ns_violation = protected_namespace.match(ann_name) is not None
Copy link
Contributor

Choose a reason for hiding this comment

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

Ismatch better thanfullmatch here? I thinkmatch might be equally capable and more practical (don't need to include.* on the end to serve as a prefix match I guess), just want to make sure you've thought about it and decided to go withmatch.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Good question - I thinkmatch is more practical, as you can use special characters (ex:^<pattern>$) to basically ensurefullmatch behavior, whereasfullmatch does that by default and thus offers less customizability 👍

sydney-runkleand others added4 commitsOctober 1, 2024 17:18
Co-authored-by: David Montague <35119617+dmontagu@users.noreply.github.com>
Merge branch 'support-re-for-protected-ns' ofhttps://github.com/pydantic/pydantic into support-re-for-protected-ns
@sydney-runklesydney-runkleenabled auto-merge (squash)October 2, 2024 13:27
@sydney-runklesydney-runkle merged commit296f2ca intomainOct 2, 2024
58 checks passed
@sydney-runklesydney-runkle deleted the support-re-for-protected-ns branchOctober 2, 2024 13:40
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@ViicosViicosViicos left review comments

@dmontagudmontagudmontagu approved these changes

Assignees
No one assigned
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@sydney-runkle@dmontagu@Viicos

[8]ページ先頭

©2009-2025 Movatter.jp