Skip to content

Move internal docs for fractions module to InternalDocs/fractions.md - #162475

Open
skirpichev wants to merge 9 commits into
python:mainfrom
skirpichev:move-fractions-internal-docs
Open

skirpichev wants to merge 9 commits into
python:mainfrom
skirpichev:move-fractions-internal-docs

Conversation

@skirpichev

Copy link
Copy Markdown
Member

This covers algorithms for addition/subtraction/multiplication.

This covers algorithms for addition/subtraction/multiplication.
@skirpichev

Copy link
Copy Markdown
Member Author

Rendered version:
https://github.com/skirpichev/cpython/blob/move-fractions-internal-docs/InternalDocs/fractions.md#algorithms-for-rational-arithmetics

This is a follow-up to #95723: proof of correctness, but this time - for arithmetics. I'm not sure if it worth: github-powered rendering of math is horrible. Though, maybe it will be improved someday.

Few questions:

  1. where we should put new section (first or last, as I did)?
  2. should we align notation with algorithm implementation? (two-letters symbols, like in code, looks ugly in latex)

Comment thread Lib/fractions.py Resolved
@StanFromIreland

Copy link
Copy Markdown
Member

CC @mdickinson

Comment thread InternalDocs/fractions.md Resolved
Comment thread InternalDocs/fractions.md Resolved
Comment thread InternalDocs/fractions.md Resolved
Comment thread InternalDocs/fractions.md Resolved
Comment thread InternalDocs/fractions.md Resolved
Comment thread InternalDocs/fractions.md Resolved
Comment thread InternalDocs/fractions.md Resolved
Comment thread InternalDocs/fractions.md Resolved
Comment thread InternalDocs/fractions.md Resolved
Comment thread InternalDocs/fractions.md Resolved
@skirpichev skirpichev added the pending The issue will be closed if no feedback is provided label Nov 30, 2026

@StanFromIreland StanFromIreland left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why is this pending?

Comment thread InternalDocs/fractions.md Resolved
Comment thread InternalDocs/fractions.md Resolved
Comment thread InternalDocs/fractions.md Resolved
Comment thread InternalDocs/fractions.md Resolved
@skirpichev skirpichev removed the pending The issue will be closed if no feedback is provided label Nov 30, 2026

@skirpichev skirpichev left a comment •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Why is this pending?

I'm trying to reduce number of my opened prs. So, I put pending label after some time of no-activity. And close them after +1-1.5 months.

Edit: closed prs are still linked to open issues, may be reviewed and reviewers may ask to reopen them.

Comment thread Lib/fractions.py
Comment on lines +404 to +405
# Khinchin (1964), Theorem 15. See also
# InternalDocs/fractions.md for details.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Suggested change
# Khinchin (1964), Theorem 15. See also
# InternalDocs/fractions.md for details.
# Khinchin (1964), Theorem 15.

I would prefer to revert this, however. Comments in the module are
self-consistent. The InternalDocs also is a standard place for internal
documentation. Not need to mention it each time, IMO.

Comment thread Lib/fractions.py
# As for addition/subtraction, we should special-case g1 == 1
# and g2 == 1 for same reason. That happens also for multiplying
# rationals, obtained from floats.
# See also InternalDocs/fractions.md for details.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Ditto here.

Suggested change
# See also InternalDocs/fractions.md for details.

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.

2 participants