Skip to content

PEP 489: Fix syntax highlighting #4456

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

Merged
merged 3 commits into from
Jun 17, 2025

Conversation

hugovk
Copy link
Member

@hugovk hugovk commented Jun 10, 2025

Most of the code blocks are C, so set that as the document highlight, and use Python on blocks where needed.

Also add inline code formatting.


📚 Documentation preview 📚: https://pep-previews--4456.org.readthedocs.build/

@encukou
Copy link
Member

encukou commented Jun 10, 2025

Umm... Does this historical document really need updating to current publication standards?

@hugovk
Copy link
Member Author

hugovk commented Jun 10, 2025

No, It's not absolutely needed, but would improve readability: the doc still exists and I was referred to it via python-pillow/Pillow#8983. I guess I should have looked up the real docs instead :)

Anyway, I can ditch the second commit if it makes it easier to review, and/or add the canonical docs banner to the top (to https://docs.python.org/3/c-api/module.html#multi-phase-initialization ?) to make it clearer this is history?

@AA-Turner
Copy link
Member

AA-Turner commented Jun 10, 2025

I think this is fine to change, it's editorial/style rather than the content, which is the class of changes we tend to take more exception to.

A

@encukou
Copy link
Member

encukou commented Jun 10, 2025

add the canonical docs banner to the top

That's the thing to do :)

It would be nice to get python/cpython#135126 in before that, and link to its new extension-modules.rst. Could I ask for a review there?

@encukou
Copy link
Member

encukou commented Jun 17, 2025

Now merged. Would a canonical docs banner like this be appropriate?

.. canonical-doc:: :ref:`python:initializing-modules`.
                   For Python 3.14+, see :ref:`py3.14:extension-modules`
                   and :ref:`py3.14:pymoduledef`

@hugovk
Copy link
Member Author

hugovk commented Jun 17, 2025

Thanks, added!

I would like to keep at least the first commit, as while this PEP is indeed historical, it is still read, and we even link to it a dozen times from the CPython docs.

@encukou encukou merged commit 25047f5 into python:main Jun 17, 2025
5 checks passed
@hugovk hugovk deleted the pep489-syntax-highlighting branch June 17, 2025 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants