[issue25964] optparse.py:1668: (file) shadows builtin

2015-12-28 Thread SilentGhost

SilentGhost added the comment:

The deprecation warning is clearly displayed at the top of the module 
documentation: https://docs.python.org/3/library/optparse.html 

Regarding variable names: it is not an issue and pychecker is simply mistaken 
here.

--

___
Python tracker 

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



[issue25964] optparse.py:1668: (file) shadows builtin

2015-12-28 Thread Martin Mokrejs

Martin Mokrejs added the comment:

But couldn't somebody just rename the variable for example to _file? I see 
optparse also in python-3.5 so I did not think it could be Deprecated.

--

___
Python tracker 

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



[issue25964] optparse.py:1668: (file) shadows builtin

2015-12-28 Thread SilentGhost

SilentGhost added the comment:

None of this warnings highlights a real issue. Furthermore, optparse module is 
deprecated and you'd be better off using argparse instead.

--
components: +Library (Lib)
nosy: +SilentGhost
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed
type: enhancement -> behavior

___
Python tracker 

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



[issue25964] optparse.py:1668: (file) shadows builtin

2015-12-28 Thread Martin Mokrejs

New submission from Martin Mokrejs:

I use pychecker for checking my python code. Seems optparse.py distributed with 
python-2.7 could be improved as well:

[system path]/optparse.py:1191: Function (__init__) has too many arguments (11)
[system path]/optparse.py:1206: Local variable (version) shadows global defined 
on line 10 in file my-test-code.py
[system path]/optparse.py:1400: Local variable (stop) not used
[system path]/optparse.py:1668: (file) shadows builtin


Interestingly, my version variable is overridden by one from optparse.py. But 
more worrisome is the 'file' variable name.

--
messages: 257110
nosy: mmokrejs
priority: normal
severity: normal
status: open
title: optparse.py:1668: (file) shadows builtin
type: enhancement
versions: Python 2.7

___
Python tracker 

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