This repository has been archived by the owner on Apr 26, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
IPv6 support #1696
Merged
Merged
IPv6 support #1696
Changes from 4 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
what's the rationale for using
dict()
rather than{}
here? i think the existing code style is to use{}
...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 just didn't change that part, but it seems
dict()
is used in a bunch of places as wellI can certainly change it to
{}
instead though.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.
looking through the results of that grep, none of those uses seem to be for constants like this, which is only why it jumped out as looking weird. it's trivial, but probably worth fixing. (disclaimer: i'm hardly a python expert, but trying to help fill in whilst @erikjohnston is out)
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.
The rationale is as follows:
**kw
, meaning it needs to be nativestr
mapped to some object.__future__
imports as possible, to make the py2 environment and the py3 environment consistent. One such import isfrom __future__ import unicode_literals
.""
to produce a nativestr
, this assumption will be broken withunicode_literals
imported.dict(**kw)
will producekw
unaltered; meaning, it will be a nativestr
even if a quoted string would produce aunicode
.So this is generally a habit I believe one should get into for py3 hygiene.
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.
okay, i'm happy to defer (and yield, for that matter) to python wisdom here ;)
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.
FWIW, Guido says you shouldn't use
unicode_literals
and they're going to add a warning about this to the official docs. (See recent thread on python-dev.)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.
Hrm. I'm not sure I fully agree with that thread, but definitely
unicode_literals
is not without its pitfalls. Nevertheless,dict(**kw)
is a clearer expression of the intent of "I intend to use this for keywords".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.
Thread here.