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 __new__ in .pyi for Rust types #743

Merged
merged 1 commit into from
Jul 5, 2023
Merged

use __new__ in .pyi for Rust types #743

merged 1 commit into from
Jul 5, 2023

Conversation

davidhewitt
Copy link
Contributor

@davidhewitt davidhewitt commented Jul 5, 2023

Change Summary

Follow up promised from #702 (comment)

The motivation is that the PyO3 types actually define __new__, not __init__, so that's what we should document in the .pyi. I checked with mypy and vscode and the type inference of the constructor seems to work just as well with __new__.

Related issue number

N/A

Checklist

  • Unit tests for the changes exist
  • Documentation reflects the changes where applicable
  • Pydantic tests pass with this pydantic-core (except for expected changes)
  • My PR is ready to review, please add a comment including the phrase "please review" to assign reviewers

Selected Reviewer: @adriangb

@davidhewitt
Copy link
Contributor Author

please review

@codecov
Copy link

codecov bot commented Jul 5, 2023

Codecov Report

Merging #743 (6198b37) into main (d08d269) will not change coverage.
The diff coverage is n/a.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #743   +/-   ##
=======================================
  Coverage   93.63%   93.63%           
=======================================
  Files          99       99           
  Lines       13895    13895           
  Branches       25       25           
=======================================
  Hits        13010    13010           
  Misses        879      879           
  Partials        6        6           

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d08d269...6198b37. Read the comment docs.

@codspeed-hq
Copy link

codspeed-hq bot commented Jul 5, 2023

CodSpeed Performance Report

Merging #743 will not alter performances

Comparing dh/pyi-new (6198b37) with main (d08d269)

Summary

✅ 126 untouched benchmarks

@davidhewitt davidhewitt merged commit 4527b80 into main Jul 5, 2023
@davidhewitt davidhewitt deleted the dh/pyi-new branch July 5, 2023 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants