Visitar URL original
gh-119189: Fix the fraction module so that __rpow__ works on arbitrary classes. by zitterbewegung · Pull Request #119242 · python/cpython · GitHub
Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update 2024-05-20-13-48-37.gh-issue-119189.dhJVs5.rst
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
  • Loading branch information
zitterbewegung and serhiy-storchaka authored May 29, 2024
commit 085a9d184d016dd518bf1c2c838b97e2f61bb74b
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
When using the ** operator with a Fraction as a base and an object that implements __rpow__ as an exponent the fraction it is now not cast to a float.
When using the ``**`` operator or :func:`pow` with :class:`~fractions.Fraction`
as the base and an exponent that is not rational, a float, or a complex, the
fraction is no longer converted to a float.