Skip to content

gh-113664: Improve style of Big O notation#113695

Merged
serhiy-storchaka merged 2 commits into
python:mainfrom
serhiy-storchaka:docs-big-o
Jan 10, 2024
Merged

gh-113664: Improve style of Big O notation#113695
serhiy-storchaka merged 2 commits into
python:mainfrom
serhiy-storchaka:docs-big-o

Conversation

@serhiy-storchaka

@serhiy-storchaka serhiy-storchaka commented Jan 4, 2024

Copy link
Copy Markdown
Member

Use cursive to make it looking like mathematical formulas.


📚 Documentation preview 📚: https://cpython-previews--113695.org.readthedocs.build/

Use cursive to make it looking like mathematical formulas.
@erlend-aasland

Copy link
Copy Markdown
Contributor

Nice. Could we use the Sphinx :math: role for this?

@Rowlando13

Rowlando13 commented Jan 5, 2024

Copy link
Copy Markdown

It was discussed in gh-113673. It looks like it was decided against because it is rendered in a different font.

@erlend-aasland

Copy link
Copy Markdown
Contributor

@Rowlando13, thanks for the heads-up; I missed that discussion. I'm fine with the consensus of using italics for such notations1.

Footnotes

  1. though, I would personally prefer the :math: rendering

@serhiy-storchaka

Copy link
Copy Markdown
Member Author

I tried also with :math: in #113724.

@hugovk

hugovk commented Jan 5, 2024

Copy link
Copy Markdown
Member

This PR with EPUB (in macOS Books):

image

image

image

@erlend-aasland

Copy link
Copy Markdown
Contributor

Digression: I don't think O(highest file descriptor) and O(number of file descriptors) is valid Big O notation. We can change that in a follow-up PR.

@encukou

encukou commented Jan 5, 2024

Copy link
Copy Markdown
Member

IMO, O(highest file descriptor) is fine. It would be more complicated if we did use :math:, where the term would need to be marked up as a single multi-letter variable (rather than a product of single-letter ones). But with simple italics, or <var> in HTML, you can get away with this.
Only change it if you can find a clearer way to express it. After all, math notation is all about being clear (to people used to reading math papers).

@serhiy-storchaka
serhiy-storchaka merged commit a862981 into python:main Jan 10, 2024
@miss-islington-app

Copy link
Copy Markdown

Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jan 10, 2024
Use cursive to make it looking like mathematic formulas.
(cherry picked from commit a862981)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
@miss-islington-app

Copy link
Copy Markdown

Sorry, @serhiy-storchaka, I could not cleanly backport this to 3.11 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker a8629816c6c0e6770248a60529fd7c9ba08aad55 3.11

@bedevere-app

bedevere-app Bot commented Jan 10, 2024

Copy link
Copy Markdown

GH-113909 is a backport of this pull request to the 3.12 branch.

@serhiy-storchaka
serhiy-storchaka deleted the docs-big-o branch January 10, 2024 13:01
@bedevere-app bedevere-app Bot removed the needs backport to 3.12 only security fixes label Jan 10, 2024
serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this pull request Jan 10, 2024
)

Use cursive to make it looking like mathematic formulas.
(cherry picked from commit a862981)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
@bedevere-app

bedevere-app Bot commented Jan 10, 2024

Copy link
Copy Markdown

GH-113910 is a backport of this pull request to the 3.11 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.11 only security fixes label Jan 10, 2024
serhiy-storchaka added a commit that referenced this pull request Jan 10, 2024
)

Use cursive to make it looking like mathematic formulas.
(cherry picked from commit a862981)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
serhiy-storchaka added a commit that referenced this pull request Jan 10, 2024
)

Use cursive to make it looking like mathematic formulas.
(cherry picked from commit a862981)
@hugovk

hugovk commented Jan 10, 2024

Copy link
Copy Markdown
Member

I've created python/devguide#1261 to document this style in the devguide.

kulikjak pushed a commit to kulikjak/cpython that referenced this pull request Jan 22, 2024
Use cursive to make it looking like mathematic formulas.
aisk pushed a commit to aisk/cpython that referenced this pull request Feb 11, 2024
Use cursive to make it looking like mathematic formulas.
Glyphack pushed a commit to Glyphack/cpython that referenced this pull request Sep 2, 2024
Use cursive to make it looking like mathematic formulas.
@serhiy-storchaka serhiy-storchaka removed their assignment Jul 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation in the Doc dir skip news

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants