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

Properly coerce fractions as int#1757

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

Open
Viicos wants to merge1 commit intomain
base:main
Choose a base branch
Loading
fromvp/fractions-int
Open

Conversation

Viicos
Copy link
Member

Change Summary

Fixespydantic/pydantic#12063.

Related issue number

Checklist

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

@ViicosViicos requested a review fromdavidhewittJuly 18, 2025 16:24
Comment on lines +288 to +291
#[cfg(Py_3_11)]
let as_int = self.call_method0("__int__");
#[cfg(not(Py_3_11))]
let as_int = self.call_method0("__trunc__");
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Not sure if there's a better way: maybe pyo3 can do the coercion directly? I've tried downcasting with no success.

@codspeed-hqCodSpeed HQ
Copy link

CodSpeed Performance Report

Merging#1757 willnot alter performance

Comparingvp/fractions-int (363bb55) withmain (37ec6e7)

Summary

✅ 157 untouched benchmarks

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@davidhewittdavidhewittAwaiting requested review from davidhewitt

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Coercion of Fraction to int inconsistent with documentation
1 participant
@Viicos

[8]ページ先頭

©2009-2025 Movatter.jp