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

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

Merged
merged 2 commits into from Jan 10, 2024

Conversation

serhiy-storchaka
Copy link
Member

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

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
Contributor

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

@Rowlando13
Copy link

Rowlando13 commented Jan 5, 2024

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
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 ↄ1�7

@serhiy-storchaka
Copy link
Member Author

I tried also with :math: in #113724.

@hugovk
Copy link
Member

hugovk commented Jan 5, 2024

This PR with EPUB (in macOS Books):

image

image

image

@erlend-aasland
Copy link
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
Copy link
Member

encukou commented Jan 5, 2024

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
25 checks passed
@miss-islington-app
Copy link

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

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

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
Copy link

bedevere-app bot commented Jan 10, 2024

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 bug and 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
Copy link

bedevere-app bot commented Jan 10, 2024

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 bug and 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
Copy link
Member

hugovk commented Jan 10, 2024

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

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.

None yet

5 participants