-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
gh-127544: Ensure that AF_DECnet is part of socket.AddressFamily, when available #127548
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
base: main
Are you sure you want to change the base?
Conversation
@@ -0,0 +1,2 @@ | |||
Ensure that ```AF_DECnet``` is part of the :class:`!socket.AddressFamily` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure why :class:`socket.AddressFamily`
didn't work.
Ensure that ```AF_DECnet``` is part of the :class:`!socket.AddressFamily` | ||
enum, when available. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ensure that ```AF_DECnet``` is part of the :class:`!socket.AddressFamily` | |
enum, when available. | |
Ensure that ``AF_DECnet`` is part of the :class:`!socket.AddressFamily` | |
enum. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why remove "when available"? It's in an ifdef
in socketmodule.c
, so CPython already hedges that it might not be present on any given system.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's a bit redundant, and when it's available, it'll appear in AddressFamily
, otherwise it won't. If it isn't modified, it seems that it must be in AddressFamily
, rather than changing with the os environment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's the opposite of how I'd read it. "when available" at the end meaning "when it's available in the OS environment, ensure that it's part of AddressFamily". Without that, I'd think that "ensure that it's in AddressFamily" means that we always ensure it's in AddressFamily, whether or not it's available from the OS, or that we think it's universally available so not worth mentioning that part.
An alternate solution would be to keep |
This MR removes the requirement that AddressFamily members are all-uppercase, in order to include
AF_DECnet
. I added a test to validate that it's part of the enum if the value is present in_socket
.