Skip to content

gh-95415: Make availability directive consistent (GH-95416) #95416

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 4 commits into from
Jul 29, 2022

Conversation

tiran
Copy link
Member

@tiran tiran commented Jul 29, 2022

@tiran tiran added docs Documentation in the Doc dir needs backport to 3.11 only security fixes labels Jul 29, 2022
@tiran tiran force-pushed the gh-95415-availability-doc branch from 1c52b29 to 1e6b8cf Compare July 29, 2022 07:43
@ezio-melotti ezio-melotti self-requested a review July 29, 2022 07:56
Copy link
Member

@encukou encukou left a comment

Choose a reason for hiding this comment

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

Big +1 on the idea, some nitpicks:

@tiran tiran requested a review from encukou July 29, 2022 12:57
@tiran tiran marked this pull request as ready for review July 29, 2022 13:23
@tiran tiran requested review from pganssle and abalkin as code owners July 29, 2022 13:23
Copy link
Member

@encukou encukou left a comment

Choose a reason for hiding this comment

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

Looks good!

@tiran tiran changed the title gh-95415: Make availability directive consistent gh-95415: Make availability directive consistent (GH-95416) Jul 29, 2022
@tiran tiran merged commit f81a6c5 into python:main Jul 29, 2022
@tiran tiran deleted the gh-95415-availability-doc branch July 29, 2022 14:42
@miss-islington
Copy link
Contributor

Thanks @tiran for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11.
🐍🍒⛏🤖

@miss-islington
Copy link
Contributor

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

tiran added a commit to tiran/cpython that referenced this pull request Jul 29, 2022
@bedevere-bot
Copy link

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

@bedevere-bot bedevere-bot removed the needs backport to 3.11 only security fixes label Jul 29, 2022
Copy link
Member

@ezio-melotti ezio-melotti left a comment

Choose a reason for hiding this comment

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

A bit late to the party since the PR already got merged, but here is my review.

.. availability:: most Unix platforms, possibly others.
.. availability:: Unix.

most Unix platforms.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
most Unix platforms.
Most Unix platforms.

@@ -429,7 +431,7 @@ since it is impossible to detect the termination of alien threads.
system-wide) from the time the thread is created until the thread
has been terminated.

.. availability:: Requires :func:`get_native_id` function.
.. availability:: Windows, FreeBSD, Linux, macOS, OpenBSD, NetBSD, AIX, DragonFlyBSD.
Copy link
Member

Choose a reason for hiding this comment

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

I would keep the previous sentence under the list of platforms.

Comment on lines +142 to +150
known_platforms = frozenset({
"AIX", "Android", "BSD", "DragonFlyBSD", "Emscripten", "FreeBSD",
"Linux", "NetBSD", "OpenBSD", "POSIX", "Solaris", "Unix", "VxWorks",
"WASI", "Windows", "macOS",
# libc
"BSD libc", "glibc", "musl",
# POSIX platforms with pthreads
"pthreads",
})
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
known_platforms = frozenset({
"AIX", "Android", "BSD", "DragonFlyBSD", "Emscripten", "FreeBSD",
"Linux", "NetBSD", "OpenBSD", "POSIX", "Solaris", "Unix", "VxWorks",
"WASI", "Windows", "macOS",
# libc
"BSD libc", "glibc", "musl",
# POSIX platforms with pthreads
"pthreads",
})
known_platforms = frozenset({
"AIX", "Android", "BSD", "DragonFlyBSD", "Emscripten", "FreeBSD",
"Linux", "NetBSD", "OpenBSD", "POSIX", "Solaris", "Unix", "VxWorks",
"WASI", "Windows", "macOS",
# libc
"BSD libc", "glibc", "musl",
# POSIX platforms with pthreads
"pthreads",
})

@@ -706,7 +706,7 @@ process and user.
:func:`socket.gethostname` or even
``socket.gethostbyaddr(socket.gethostname())``.

.. availability:: recent flavors of Unix.
.. availability:: Unix.
Copy link
Member

Choose a reason for hiding this comment

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

Should these get a note like Might not be available on less recent flavors of Unix. or Might not be available on some flavors of Unix.? Even better would be to be more specific (e.g. Not available on Unix flavors that ...).

Copy link
Member Author

Choose a reason for hiding this comment

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

uname is available on all Unix-like platforms that we support. It was standardized in IEEE Std 1003.1-2001, https://pubs.opengroup.org/onlinepubs/009604599/functions/uname.html . Every POSIX-like OS released in the last 20 years should have it.

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants