Skip to content

gh-78646: Added support for bytearrray type , to create IPv4 addresss #8908

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

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

prudvinit
Copy link

@prudvinit prudvinit commented Aug 24, 2018

@the-knights-who-say-ni
Copy link

Hello, and thanks for your contribution!

I'm a bot set up to make sure that the project can legally accept your contribution by verifying you have signed the PSF contributor agreement (CLA).

Unfortunately our records indicate you have not signed the CLA. For legal reasons we need you to sign this before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue.

You can check yourself to see if the CLA has been received.

Thanks again for your contribution, we look forward to reviewing it!

Lib/ipaddress.py Outdated
@@ -1287,7 +1287,7 @@ def __init__(self, address):
return

# Constructing from a packed address
if isinstance(address, bytes):
if isinstance(address, bytes) or isinstance(address, bytearray):
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it would be better to pass a tuple to isinstance.

if isinstance(address, (bytes, bytearray)):

And there are couple of more code lines that use isinstance

@@ -0,0 +1 @@
Addeded support for bytearray in creating a new IPv4 address.
Copy link

Choose a reason for hiding this comment

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

Addeded is not a word

Lib/ipaddress.py Outdated
@@ -1287,7 +1287,7 @@ def __init__(self, address):
return

# Constructing from a packed address
if isinstance(address, bytes):
if isinstance(address, (bytes,bytearray)):
Copy link

Choose a reason for hiding this comment

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

Shouldn't there be a space here?

Copy link

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 Dec 15, 2024
@picnixz picnixz changed the title bpo-34465: Added support for bytearrray type , to create IPv4 addresss gh-78646: Added support for bytearrray type , to create IPv4 addresss Dec 15, 2024
@github-actions github-actions bot removed the stale Stale PR or inactive for long period of time. label Feb 27, 2025
Copy link

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 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting core review stale Stale PR or inactive for long period of time.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants