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

Add TzInfo.__new__ stub method #1611

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Add TzInfo.__new__ stub method #1611

wants to merge 1 commit into from

Conversation

Viicos
Copy link
Member

@Viicos Viicos commented Jan 28, 2025

Change Summary

Fixes #1605

Related issue number

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

@Viicos
Copy link
Member Author

Viicos commented Jan 28, 2025

Hum, stubtest works even though I commented out the stub __new__ and added the pyo3 signature 🤔

Copy link

codspeed-hq bot commented Jan 28, 2025

CodSpeed Performance Report

Merging #1611 will not alter performance

Comparing tz-info-new (7cd0d41) with main (0ede4d1)

Summary

✅ 157 untouched benchmarks

Copy link
Contributor

@davidhewitt davidhewitt left a comment

Choose a reason for hiding this comment

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

Thanks with one possible simplification!

@@ -548,6 +548,7 @@ pub struct TzInfo {
#[pymethods]
impl TzInfo {
#[new]
#[pyo3(signature = (seconds))]
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this should be autogenerated, does the subtest still pass if you remove this?

@davidhewitt
Copy link
Contributor

Oh stubtest doesn't catch this? Hmm I wonder if it doesn't check __new__ just __init__. PyO3 really needs to improve things here 🤔

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.

Wrong type annotation for pydantic_core.TzInfo(0)
2 participants