Prev: use python as a calculator
Next: mod_python and css
From: Robert Kern on 25 Jun 2010 18:48 On 6/25/10 4:31 PM, GrayShark wrote: > Why the rudness Terry Jan Reedy? Get up on the wrong side of the bed? Or > worse luck, no one on the other side to create a wrong side? > > As to your comment about Logilab's pylint. I'v seen a ticket similar to > this from three months back. I assume they're not fixing it because if > you review 'string' via pydoc you'd read this: > > --------------------------------------- > Help on module string: > > NAME > string - A collection of string operations (most are no longer used). > > FILE > /usr/lib64/python2.6/string.py > > DESCRIPTION > Warning: most of the code you see here isn't normally used nowadays. > Beginning with Python 1.6, many of these functions are implemented as > methods on the standard string object. They used to be implemented by > a built-in module called strop, but strop is now obsolete itself. > > --------------------------------------- > > Not the 1.6. Seems some serious work went into putting the 'string's > functionality into _builtin_. Note the "most". The module as a whole is *not* deprecated, just most of the functions. In particular, the constants you imported are not deprecated. You are supposed to get them from the string module. pylint is incorrect, or at least imprecise, in labeling the string module as deprecated. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco
From: John Pinner on 26 Jun 2010 06:56 On Jun 25, 11:14 pm, Steven D'Aprano <st...(a)REMOVE-THIS- cybersource.com.au> wrote: > On Fri, 25 Jun 2010 16:31:17 -0500, GrayShark wrote: > > Why the rudness Terry Jan Reedy? Get up on the wrong side of the bed? Or > > worse luck, no one on the other side to create a wrong side? > > I see only one person being rude here, and that's you. True. > Terry made the > very reasonable observation that you would serve the community, and thank > us, by posting a bug report to pylint, rather than just ignoring it, and > you respond with a totally bogus accusation of "rudeness" followed by > comments about what you imagine Terry's personal life is like. > Except that it is not a bug, but a configuration issue: pylint's behaviour is governed by its config file, pylintrc. In the [IMPORTS] section, there is a line: deprecated-modules=regsub,string,TERMIOS,Bastion,rexec So if you edit this line to remove string, the warning will not be made. Although I find that most of the default pylint settings are eminently sensible, and wouldn't remove string from the deprecated modules myself. I find pylint (and pychecker) to be invaluable. Thanks to our friends at Logilab for pylint, and to Neal Norwitz for pychecker! > As for your guess as to why pylint haven't fixed the ticket "similar to" > this issue: > > > As to your comment about Logilab's pylint. I've seen a ticket similar to > > this from three months back. I assume they're not fixing it because if > > you review 'string' via pydoc you'd read this: > > [...] > > Or possibly the ticket has just been missed, and all it needs is a > comment made saying "This has bitten me too" and somebody will attend to > it. > > Or not -- who knows? But making *assumptions* that a pylint bug won't be > fixed because of the docstring in the string module is foolish. Unless > the bug is marked as "Won't fix", the safe assumption is that it hasn't > been worked on YET. Like I said, it isn't a bug... Best wishes, John -- EuroPython is coming! http://europython.eu 17th-24th July 2010, Birmingham, UK.
From: Stephen Hansen on 26 Jun 2010 15:43
On 6/26/10 3:56 AM, John Pinner wrote: > On Jun 25, 11:14 pm, Steven D'Aprano<st...(a)REMOVE-THIS- > cybersource.com.au> wrote: >> Terry made the >> very reasonable observation that you would serve the community, and thank >> us, by posting a bug report to pylint, rather than just ignoring it, and >> you respond with a totally bogus accusation of "rudeness" followed by >> comments about what you imagine Terry's personal life is like. >> > Except that it is not a bug, but a configuration issue: IMHO, default configuration that produces results which are factually wrong count as a bug. :) Since the "string" module itself is not and never has been deprecated, if default pylint configuration claims it does that's a problem-- now if a user wants to go add say, 'os' to a list of deprecated modules, then we can't blame pylint for complaining incorrectly. The user asked it to do a wrong thing. I don't use pylint -- so don't know -- but surely there has to be a way to specify deprecated functions and have it warn you, instead of whole modules? Since deprecating certain functions seems far more common then modules at large. Not that I've done any sort of study, so I might be totally off base on that count. -- ... Stephen Hansen ... Also: Ixokai ... Mail: me+list/python (AT) ixokai (DOT) io ... Blog: http://meh.ixokai.io/ |