Skip to content

bpo-46646: mention that bytes are accepted in ipaddress docs#31139

Open
sobolevn wants to merge 1 commit into
python:mainfrom
sobolevn:issue-46646
Open

bpo-46646: mention that bytes are accepted in ipaddress docs#31139
sobolevn wants to merge 1 commit into
python:mainfrom
sobolevn:issue-46646

Conversation

@sobolevn

@sobolevn sobolevn commented Feb 5, 2022

Copy link
Copy Markdown
Member

I've also added a simple doctest case for ip_interface, because it was the only one without it 🙂

https://bugs.python.org/issue46646

@GBeauregard

Copy link
Copy Markdown
Contributor

It seems the tests are a bit broken right now, but it wasn't obvious to me which commit or CI change broke things when I looked

Comment thread Doc/library/ipaddress.rst
Comment on lines 42 to 48
Return an :class:`IPv4Address` or :class:`IPv6Address` object depending on
the IP address passed as argument. Either IPv4 or IPv6 addresses may be
the IP address passed as argument.
*address* is a string or integer or bytes representing the IP address.
Either IPv4 or IPv6 addresses may be
supplied; integers less than ``2**32`` will be considered to be IPv4 by default.
A :exc:`ValueError` is raised if *address* does not represent a valid IPv4
or IPv6 address.

@GBeauregard GBeauregard Feb 5, 2022

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It makes the diff ugly, but maybe it's still worth reflowing these to fit the style in the rest of the file? Is there a convention when making these changes (to not do this)? (would love a resource if you have one)

   Return an :class:`IPv4Address` or :class:`IPv6Address` object depending on
   the IP address passed as argument. *address* is a string or integer or bytes
   representing the IP address. Either IPv4 or IPv6 addresses may be supplied;
   integers less than ``2**32`` will be considered to be IPv4 by default. A
   :exc:`ValueError` is raised if *address* does not represent a valid IPv4 or
   IPv6 address.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I don't have an opinion on that, I will do anything that is considered the best by maintainers 🙂

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The feedback I got from this PR was that it's generally preferred to keep the diff on docs PRs as small as possible, even if that means that some lines go way over (or way under) the 80-char PEP8 limit.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If a line really goes way over 80 characters, then split it in two 🙂

@MaxwellDupre MaxwellDupre left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The diff doesn't look that bad to me. More important is the finished Docs and they read ok.

@AlexWaygood

AlexWaygood commented Jun 18, 2022

Copy link
Copy Markdown
Member

The diff doesn't look that bad to me. More important is the finished Docs and they read ok.

We shouldn't be documenting that bytes are supported for these functions if passing bytes in is completely untested: #90804 (comment).

merwok
merwok previously approved these changes Jun 20, 2022
@sobolevn

sobolevn commented Nov 14, 2022

Copy link
Copy Markdown
Member Author

@JelleZijlstra should we also document that it also accepts tuple?
Coming back from python/typeshed#8966

@JelleZijlstra

Copy link
Copy Markdown
Member

Not sure, is tuple support tested in CPython?

If we document it, we should be precise about what the tuple represents.

@github-actions

Copy link
Copy Markdown

This PR is stale because it has been open for 30 days with no activity.

@github-actions github-actions Bot added the stale Stale PR or inactive for long period of time. label Apr 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting merge skip news stale Stale PR or inactive for long period of time.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants