-
-
Notifications
You must be signed in to change notification settings - Fork 31.8k
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
base: main
Are you sure you want to change the base?
Conversation
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): |
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 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. |
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.
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)): |
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.
Shouldn't there be a space here?
This PR is stale because it has been open for 30 days with no activity. |
This PR is stale because it has been open for 30 days with no activity. |
https://bugs.python.org/issue34465