[issue15280] Don't use builtins as variable names in urllib.request

Martin Panter report at bugs.python.org
Mon Oct 5 00:58:00 EDT 2015


Martin Panter added the comment:

The name changes to the function parameters should be avoided without a good reason.

I would recommend rejecting all of the changes in this patch. They are basically changing one person’s coding style to another person’s style. I happen to prefer list() and map() over the list comprehension syntax.

I don’t have a problem with a variable named “type” in a small function. For instance, open_unknown() is only four lines, including signature and doc string! If you can’t easily predict all the variables in a larger function, then I suggest dividing it into smaller components. PEP 8 doesn’t seem to mention the issue of shadowing variable names that I can see anyway.

----------
nosy: +martin.panter
stage:  -> patch review
type:  -> enhancement

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue15280>
_______________________________________


More information about the Python-bugs-list mailing list