Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Self where possible #9479

Merged
merged 4 commits into from
May 22, 2024
Merged

Use Self where possible #9479

merged 4 commits into from
May 22, 2024

Conversation

Viicos
Copy link
Member

@Viicos Viicos commented May 21, 2024

Change Summary

  • Some cleaning, can be reviewed commit per commit.

Related issue number

Checklist

  • The pull request title is a good summary of the changes - it will be used in the changelog
  • Unit tests for the changes exist
  • Tests pass on CI
  • Documentation reflects the changes where applicable
  • My PR is ready to review, please add a comment including the phrase "please review" to assign reviewers

Selected Reviewer: @davidhewitt

@github-actions github-actions bot added the relnotes-fix Used for bugfixes. label May 21, 2024
Copy link

codspeed-hq bot commented May 21, 2024

CodSpeed Performance Report

Merging #9479 will not alter performance

Comparing Viicos:use-self (214ad3a) with main (c488508)

Summary

✅ 13 untouched benchmarks

@Viicos
Copy link
Member Author

Viicos commented May 21, 2024

Please review

Copy link
Member

@sydney-runkle sydney-runkle left a comment

Choose a reason for hiding this comment

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

Great work here!

@sydney-runkle sydney-runkle merged commit eeea647 into pydantic:main May 22, 2024
53 checks passed
@Viicos Viicos deleted the use-self branch May 22, 2024 13:54
@vikyw89
Copy link

vikyw89 commented Jul 16, 2024

Is this one intended to be a breaking change ?

if resolved_bases is not __base__:
ns['__orig_bases__'] = __base__
namespace.update(ns)

return meta(
__model_name,
model_name,
Copy link

Choose a reason for hiding this comment

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

this one is breaking backwards compatibility

def create_model(
__model_name: str,
model_name: str,
Copy link

Choose a reason for hiding this comment

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

this one is breaking backwards compatibility

@Viicos
Copy link
Member Author

Viicos commented Jul 16, 2024

@vikyw89 You can read more about it here: https://typing.readthedocs.io/en/latest/spec/historical.html#positional-only-parameters.

It is technically a breaking change, although using __model_name as a kw-argument would have be caught by type checkers in the first place. Sorry for the inconvenience, probably the changelog should be updated as per the issue that was opened by @fraser-langton

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants