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-109634: Use :samp: role #109635

Merged
merged 3 commits into from
Sep 23, 2023
Merged

Conversation

serhiy-storchaka
Copy link
Member

@serhiy-storchaka serhiy-storchaka commented Sep 21, 2023

@@ -1012,7 +1012,7 @@ differently depending if the ``Py_BUILD_CORE_MODULE`` macro is defined:
* Use ``Py_IMPORTED_SYMBOL`` otherwise.

If the ``Py_BUILD_CORE_BUILTIN`` macro is used by mistake on a C extension
built as a shared library, its ``PyInit_xxx()`` function is not exported,
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@AA-Turner AA-Turner left a comment

Choose a reason for hiding this comment

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

A nice improvement!

A

@@ -88,8 +88,8 @@ startup by the :c:func:`PyConfig_Read` function: see
On some systems, conversion using the file system encoding may fail. In this
case, Python uses the :ref:`surrogateescape encoding error handler
<surrogateescape>`, which means that undecodable bytes are replaced by a
Unicode character U+DCxx on decoding, and these are again translated to the
original byte on encoding.
Unicode character U+DC\ *xx* on decoding, and these are again
Copy link
Member

Choose a reason for hiding this comment

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

Did the role not work here? (I think backslash-escaped spaces are a little ugly & we should avoid if possible; but not a blocker)

Copy link
Member Author

Choose a reason for hiding this comment

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

I do not think that U+DCxx should be rendered with typewriter font.

+----------------------+---------------------------------+-------+
| Escape Sequence | Meaning | Notes |
+======================+=================================+=======+
| ``\N{name}`` | Character named *name* in the | \(5) |
Copy link
Member

Choose a reason for hiding this comment

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

:samp:`\N{\\{name\\}}` would work. But ungainly.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thank you for pointing out that backslash have a special meaning in the :samp: role. All other occurrences of backslash should be doubled.

In this example it should be :samp:`\\N\\{{name}\\}`, because curly braces should be outside of the variable part. I am surprised that \ before { needs to be doubled, but it is how it works.

@@ -125,7 +125,7 @@ and to C extension code as :c:data:`!Py_Py3kWarningFlag`.

.. seealso::

The 3xxx series of PEPs, which contains proposals for Python 3.0.
The 3\ *xxx* series of PEPs, which contains proposals for Python 3.0.
Copy link
Member

Choose a reason for hiding this comment

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

Same note on avoiding backslash-escaped spaces if possible

Copy link
Contributor

@erlend-aasland erlend-aasland left a comment

Choose a reason for hiding this comment

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

Nice; thanks!

@serhiy-storchaka serhiy-storchaka merged commit 92af0cc into python:main Sep 23, 2023
16 checks passed
@miss-islington
Copy link
Contributor

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

@serhiy-storchaka serhiy-storchaka deleted the docs-samp-role branch September 23, 2023 06:31
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Sep 23, 2023
(cherry picked from commit 92af0cc)

Co-authored-by: Serhiy Storchaka <[email protected]>
@miss-islington
Copy link
Contributor

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 92af0cc580051fd1129c7a86af2cbadeb2aa36dc 3.11

@bedevere-app
Copy link

bedevere-app bot commented Sep 23, 2023

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

@bedevere-app bedevere-app bot removed the needs backport to 3.12 bug and security fixes label Sep 23, 2023
serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this pull request Sep 23, 2023
(cherry picked from commit 92af0cc)

Co-authored-by: Serhiy Storchaka <[email protected]>
@bedevere-app
Copy link

bedevere-app bot commented Sep 23, 2023

GH-109778 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 Sep 23, 2023
Yhg1s pushed a commit that referenced this pull request Sep 24, 2023
gh-109634: Use :samp: role (GH-109635)
(cherry picked from commit 92af0cc)

Co-authored-by: Serhiy Storchaka <[email protected]>
csm10495 pushed a commit to csm10495/cpython that referenced this pull request Sep 28, 2023
serhiy-storchaka added a commit that referenced this pull request Sep 29, 2023
(cherry picked from commit 92af0cc)

Co-authored-by: Jacob Coffee <[email protected]>
Glyphack pushed a commit to Glyphack/cpython that referenced this pull request Sep 2, 2024
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