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

2015-10-04 Thread Martin Panter

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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2015-10-04 Thread R. David Murray

R. David Murray added the comment:

I agree.  The one change that has a non-style motivation (type) is one that 
should not be made for backward compatibility reasons.

--
resolution:  -> rejected
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2012-09-28 Thread Michael Foord

Michael Foord added the comment:

Code cleanups for their own sake sound like a good thing, *iff* the cleanup is 
worthwhile (for example it makes debugging easier). i.e. the cleanup isn't 
gratuitous but worthwhile. 

This seems to be the case here and the rejected patch in issue #15137 had other 
(better) reasons to reject it as it stood.

Not accepting cleanups greatly limits the opportunity for our code base to 
improve.

--
nosy: +michael.foord
status: pending - open

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15280
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2012-09-28 Thread Éric Araujo

Éric Araujo added the comment:

Well, here I don’t see the benefit in avoiding the use of “file”, given that 
the builtin of the same name is not needed thanks to the open function 
(contrary to id, type, str, string and others).

If you think our (unwritten?) policy of not doing cleanup-only commits is 
wrong, you could bring it up on a mailing list (maybe committers to avoid an 
endless thread).

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15280
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2012-07-14 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

We don’t do code cleanups for their own sake, but rather as part of a bug fix 
or feature addition.  Please see #15137 for a longer explanation.

--
nosy: +eric.araujo, r.david.murray, terry.reedy

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15280
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2012-07-14 Thread Brian Brazil

Brian Brazil brian.bra...@gmail.com added the comment:

This patch is a result of frustration encountered when debugging #15002.
Not being able to use 'type' directly is rather annoying, so after figuring
that bug out I set some time aside to make it easier for the next person.

This could be considered a bug that urllib is hard to debug and breaks
vim's syntax highlighting.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15280
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2012-07-14 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

 Not being able to use 'type' directly is rather annoying, so after figuring 
 that bug out I set
 some time aside to make it easier for the next person.
If you make a patch for #15002 then by all means rename “type” to “filetype” so 
that you can use the type function without jumping through hoops.  Or see if 
using isinstance can avoid the need for type.

Note that Python lets you override a built-in name, it’s only a PEP 8 
convention that recommends to avoid doing so.  In many cases it makes a lot of 
sense to name something “type” (typically a class attribute), “file” (like in 
the print function in 3.x) or “open” (see tarfile, gzip, tokenize, etc.).

 This could be considered a bug that urllib is hard to debug
I don’t think so; we prefer keeping the code similar between branches so that 
patches are easier to port.

 and breaks vim's syntax highlighting.
I am a Vim user and think there are great things (like the fact that string 
delimiters are not highlighted as string contents) and debatable things (like 
the special color for self and built-in functions).

Your help with fixing bugs is very appreciated, but I think this patch will be 
rejected.

--
status: open - pending

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15280
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2012-07-13 Thread Terry J. Reedy

Changes by Terry J. Reedy tjre...@udel.edu:


--
nosy: +orsenthil

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15280
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2012-07-07 Thread Brian Brazil

New submission from Brian Brazil brian.bra...@gmail.com:

See attached patch, there's still self.type in places. I also converted one map 
to a list comprehension.

--
components: Library (Lib)
files: urllib-request-cleanup-builtin-names.patch
keywords: patch
messages: 164874
nosy: bbrazil
priority: normal
severity: normal
status: open
title: Don't use builtins as variable names in urllib.request
versions: Python 3.4
Added file: 
http://bugs.python.org/file26304/urllib-request-cleanup-builtin-names.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15280
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com