-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
add InetAddr constructor from string #31459
Conversation
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.
Seems good to me.
I've added a news entry. I think documentation should be added in a separate PR as here I'm just adding a constructor, the type existed already (unexported and undocumented). EDIT: nevermind, now I see the concern. If I don't add docs here it with compat annotation it'll be hard to tell in the future that one of the constructors was added afterwards. I've just added docs and compat annotation. |
Thanks for the feedback, I've included your suggestions! |
Changed version compat to 1.3, squashed and merged to master. |
This makes it easier to write code that would work with either a
String
or aIPAddr
. Some packages like HTTP write their own internal method for this (https://github.com/JuliaWeb/HTTP.jl/blob/master/src/Servers.jl#L184) but I think something likeInetAddr("127.0.0.1", 8000)
is sufficiently unambiguous that it should have its own official constructor.