-
-
Notifications
You must be signed in to change notification settings - Fork 34.8k
bpo-30296: Partially revert #1489. #2624
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -460,7 +460,7 @@ def configure_custom(self, config): | |
| c = self.resolve(c) | ||
| props = config.pop('.', None) | ||
| # Check for valid identifiers | ||
| kwargs = dict((k, config[k]) for k in config if valid_ident(k)) | ||
| kwargs = {k: config[k] for k in config if valid_ident(k)} | ||
| result = c(**kwargs) | ||
| if props: | ||
| for name, value in props.items(): | ||
|
|
@@ -723,7 +723,7 @@ def configure_handler(self, config): | |
| config['address'] = self.as_tuple(config['address']) | ||
| factory = klass | ||
| props = config.pop('.', None) | ||
| kwargs = dict((k, config[k]) for k in config if valid_ident(k)) | ||
| kwargs = {k: config[k] for k in config if valid_ident(k)} | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is an improvement. Go ahead. |
||
| try: | ||
| result = factory(**kwargs) | ||
| except TypeError as te: | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3839,7 +3839,7 @@ def write_docstringdict(filename="turtle_docstringdict"): | |
| docsdict[key] = eval(key).__doc__ | ||
|
|
||
| with open("%s.py" % filename,"w") as f: | ||
| keys = sorted(x for x in docsdict.keys() | ||
| keys = sorted(x for x in docsdict | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is an improvement. Go ahead. |
||
| if x.split('.')[1] not in _alias_list) | ||
| f.write('docsdict = {\n\n') | ||
| for key in keys[:-1]: | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1286,7 +1286,8 @@ def do_open(self, http_class, req, **http_conn_args): | |
| h.set_debuglevel(self._debuglevel) | ||
|
|
||
| headers = dict(req.unredirected_hdrs) | ||
| headers.update((k, v) for k, v in req.headers.items() if k not in headers) | ||
| headers.update({k: v for k, v in req.headers.items() | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please leave as-is. Don't create an unnecessary intermediate dictionary.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I afraid that this change changed semantic. |
||
| if k not in headers}) | ||
|
|
||
| # TODO(jhylton): Should this be redesigned to handle | ||
| # persistent connections? | ||
|
|
||
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.
This is an improvement. Go ahead.