[code-quality] Re: Pytest fixtures for setup/teardown

2025-06-22 Thread Skip Montanaro via code-quality
gt; > Cheers, > > On Sun, Jun 22, 2025 at 5:18 PM Skip Montanaro via code-quality < > code-quality@python.org> wrote: > >> Thanks. The Web server aspect of things is pretty minimal. I get ics >> Files from a server then process them in different ways. I do need to ma

[code-quality] Re: Pytest fixtures for setup/teardown

2025-06-22 Thread Skip Montanaro via code-quality
; real live web server. (And in fact, it's generally valuable to check that > the code being tested doesn't make any HTTP requests other than the ones > it's specifically supposed to, which you couldn't do as well if you made > your server handle arbitrary requests by s

[code-quality] Re: Pytest fixtures for setup/teardown

2025-06-22 Thread Skip Montanaro via code-quality
ifferent tests interfere with each other if you > reuse resources, unless you're very careful. > > David > > > ---- Original Message > On 6/20/25 6:31 AM, Skip Montanaro via code-quality wrote: > > I'm struggling trying to understand how Pytest's fixt

[code-quality] Pytest fixtures for setup/teardown

2025-06-20 Thread Skip Montanaro via code-quality
I'm struggling trying to understand how Pytest's fixtures can be used to facilitate setup and teardown of long-running resource servers. For example, I want to fire up a little web server (because the tool I'm testing queries a web server IRL) to serve up some simple content. I don't want to start

[code-quality] Re: code-quality Digest, Vol 120, Issue 1

2025-02-18 Thread Skip Montanaro via code-quality
> > do you know what this line does? > > ``` > skip_install = true > ``` Sorry, I can't tell if this is a rhetorical question or not. On the off-chance you want an answer, I'll refer you to the tox documentation : skip_install

[code-quality] Re: Getting tox dependencies from pyproject.toml?

2025-02-17 Thread Skip Montanaro via code-quality
> > One option would be to allow tox to install the package in the lint env > with `skip_install = false` (which is the default behaviour, so the > skip_install line can just be deleted). Then the "deps =" for the lint env > can go back to just pylint. It's not the most efficient, but saves on > co

[code-quality] Getting tox dependencies from pyproject.toml?

2025-02-17 Thread Skip Montanaro via code-quality
I have a small package with several dependencies. From pyproject.toml: dependencies = [ "atpublic>=3.1", "matplotlib>=3.5.2", "numpy>=1.22", "pandas>=1.5.2", "python-dateutil>=2.8.2", "scipy>=1.15.1", "unum>=4.2.1", "xlrd>=2.0.1", "xlwt>=1.3.0", "openpyxl>=3

[code-quality] Re: Coverage not catching execution in my Flask app

2022-01-22 Thread Skip Montanaro
> > During development, web frameworks often spawn a subprocess to serve >> requests so that they can reload the code if it changes. You might be >> measuring only the first process, and not the spawned process that is >> actually doing the work. >> > Ah, thanks Ned. That makes sense. I suspect the

[code-quality] Re: Coverage not catching execution in my Flask app

2022-01-22 Thread Skip Montanaro
> > During development, web frameworks often spawn a subprocess to serve > requests so that they can reload the code if it changes. You might be > measuring only the first process, and not the spawned process that is > actually doing the work. > Ah, thanks Ned. That makes sense. I suspect the subpr

[code-quality] Coverage not catching execution in my Flask app

2022-01-22 Thread Skip Montanaro
the Werkzeug Server') ! func() ! return 'Server shutting down...\n' Clearly, coverage noticed the action which happened during import, but despite the fact that I really did request /env, /api/help, and /shutdown, it never thought any of them were called. Any idea w

[code-quality] Pip borks the #! line when installing pylint from Python sandbox

2020-03-03 Thread Skip Montanaro
e forced to edit the relevant command scripts once they are installed in ~/.local/bin? Thanks, Skip Montanaro ___ code-quality mailing list -- code-quality@python.org To unsubscribe send an email to code-quality-le...@python.org https://mail.python.org/mailman3/lists/code-quality.python.org/

[code-quality] Is there a tool which will catch this sort of mistake?

2018-05-18 Thread Skip Montanaro
ppy for a false positive or two. I'm well-steeped in use of # pylint: disable=... One more in rare cases wouldn't be a big deal. (I'd be happy to try and write a checker for pylint. Last time I looked though a few years ago, I lacked enough knowledge of the code base to knock s

Re: [code-quality] Catching multiple return types

2018-04-18 Thread Skip Montanaro
Thanks, good to know. Yet another tool for the kit... S On Wed, Apr 18, 2018, 3:43 PM Dan Stromberg wrote: > > IINM, mypy can catch such things. But that's a different sort of tool of > course. > > On Wed, Apr 18, 2018 at 1:25 PM, Skip Montanaro > wrote: > >>

[code-quality] Catching multiple return types

2018-04-18 Thread Skip Montanaro
Is there a static checker which will catch multiple return types? Consider this dumb example: def func(a, b, c): if c: return (a, b) return 0 I thought pylint had a checker for that, but running with --rcfile=/dev/null didn't complain about the different types being returned. Is t

Re: [code-quality] Small pyflakes surprise

2018-03-19 Thread Skip Montanaro
> Running "make lint" today, I saw pyflakes emit messages for a file > named utils.py.~1~, that is, an Emacs backup file. This is a new file > in my sandbox which hasn't yet been added to the Git repo, so Emacs > knows to create backups. (Once checked in, it will rely on Git.) It > seems odd to me

[code-quality] Small pyflakes surprise

2018-03-19 Thread Skip Montanaro
knows to create backups. (Once checked in, it will rely on Git.) It seems odd to me that pyflakes would decide to check such a file. Is this a bug or a feature? Looks like we are running 1.6.0, which appears to be more-or-less current. Thx, Skip Montanaro ___

[code-quality] A couple pylint feature requests

2018-01-10 Thread Skip Montanaro
As I work through code, especially while refactoring, I wish pylint was at times more stringent about lack of use of certain types of objects. At the moment, I'm thinking of two scenarios, main programs and private attributes. There's a clear difference between a program and a module, the main one

[code-quality] How to tell pylint about base class attributes?

2015-10-19 Thread Skip Montanaro
o say, "class B, a subclass of class A which you can't see, really does have an attribute named x"? The code for class A is not going to be available, as I'm just running pylint in isolation from the rest of the environment in which it is r

Re: [code-quality] Pylint reports, is anyone using them?

2015-08-18 Thread Skip Montanaro
On Tue, Aug 18, 2015 at 5:00 PM, Claudiu Popa wrote: > For pylint users, what do you think about the removal of these > reports from pylint? Would it cause problems for you? > Are these reports in any sense useful for you? > No problem removing them. Not really useful in my experience, except ve

Re: [code-quality] Spurious unused variable messages

2015-06-10 Thread Skip Montanaro
On Wed, Jun 10, 2015 at 3:48 PM, Ian Cordasco wrote: > So, I'm not sure how much pylint will read into that statement. It > has to recognize a few things: > > 1. String formatting (admittedly not that hard when the string wasn't >built up, as in this example) As I stated, I think that string

[code-quality] Spurious unused variable messages

2015-06-10 Thread Skip Montanaro
ith pylint's node traversal handlers (all the visit_* methods in variables.py). Can someone point me to some documentation for how this works, and what visit_* methods I can define? Thanks, Skip Montanaro ___ code-quality mailing list code-quality@python.org https://mail.python.org/mailman/listinfo/code-quality

Re: [code-quality] Is it possilbe to run pyLint on a string

2015-02-27 Thread Skip Montanaro
On Fri, Feb 27, 2015 at 12:37 PM, Piotr Kupczyk wrote: > thanks for reply. I am actually looking for an option to not create > any files (even temporary) at all. > Is there still an option to use pylint on a string? Now that I'm not responding from my phone, I could more easily poke around the do

Re: [code-quality] Is it possilbe to run pyLint on a string

2015-02-26 Thread Skip Montanaro
> I am wondering whether it is possible to run > pylint on a string containing code. You could write the string to a temp file, and run pylint on that file. Skip ___ code-quality mailing list code-quality@python.org https://mail.python.org/mailman/listi

[code-quality] Pylint 1.4 complains about parenthesized indentation

2015-02-01 Thread Skip Montanaro
In Emacs, python-mode (both Barry Warsaw's version and the GNU Emacs rewrite) indent line continuations in parens so that the next line begins in the column after the opening paren. They are quite consistent about this. For example: curs.execute("update swimmers" " set usms_id = ?" " where

Re: [code-quality] Speeding up pylint

2014-12-22 Thread Skip Montanaro
On Sun, Dec 21, 2014 at 7:16 PM, Chris Martin wrote: > Pylint runs for several minutes on my project; I'd like to add it to my CI > build, but I'm not sure I want to introduce that much delay. > > Is there any trick to optimizing it? Are there some particularly slow > inspections that I could disa

[code-quality] The union of all tools

2014-12-08 Thread Skip Montanaro
Thinking about the discussion I (inadvertently) started about what sorts of issues should cause tools like pylint and pyflakes to emit messages, got me thinking about how I try to use these tools. I don't know what the current suite of all available static checking tools is, but let me just assume

Re: [code-quality] This seems like a good warning candidate...

2014-12-08 Thread Skip Montanaro
On Mon, Dec 8, 2014 at 1:32 PM, Phil Frost wrote: > Maybe. As a matter of principle, Pyflakes should only emit a warning for > things that it is sure is an error. The avoidance of false positives is a noble goal, but given the dynamic nature of Python, I'm happy to put up with a few if it means

[code-quality] This seems like a good warning candidate...

2014-12-08 Thread Skip Montanaro
I just bumped into a bug, reusing the same loop variable in two nested for loops. Here's an example: def f(x): for i in range(x): for i in [1, 2, 3]: print i Neither pylint nor flake8 warned about this problematic usage. Had i or x shadowed a global of the same name, pylin

Re: [code-quality] Warn on list comprehension variables used outside list comprehensions?

2014-11-26 Thread Skip Montanaro
On Wed, Nov 26, 2014 at 10:51 AM, Keith Derrick wrote: > But it seems to be confused by the second case, flagging "y" as an > invalid variable-name at the assignment point for both versions. > I think that's just because pylint, by default, doesn't like variable names with fewer than three chara

Re: [code-quality] Warn on list comprehension variables used outside list comprehensions?

2014-11-26 Thread Skip Montanaro
> That's not the point of this check. The point of this check is that on > Python 2, the binding to x in the comprehension bleeds outside of the > comprehension scope Got it. Still, this code: > x = 10 > [x for x in range(3)] > print(x + 1) will run differently in Python 2 than Pyth

Re: [code-quality] Warn on list comprehension variables used outside list comprehensions?

2014-11-26 Thread Skip Montanaro
On Wed, Nov 26, 2014 at 8:30 AM, Ian Cordasco wrote: > > The trick here would be ensuring this only applies to Python 2. Take > for example the following on Python 3: > > [x for x in range(3)] > print(x) > > You will get a NameError because x is undefined outside the list > comprehension.

Re: [code-quality] Problems running pylint 1.4.0

2014-11-26 Thread Skip Montanaro
On Wed, Nov 26, 2014 at 7:39 AM, Skip Montanaro wrote: > Let me see if fixing that solves the problem. My guess is that it will. That was it! Thanks for the excellent hint, Marius. Skip ___ code-quality mailing list code-quality@python.org ht

Re: [code-quality] Problems running pylint 1.4.0

2014-11-26 Thread Skip Montanaro
On Wed, Nov 26, 2014 at 4:02 AM, Marius Gedminas wrote: > What's in the #! line of /opt/local/bin/pylint? Ack! I'll bet that's the problem. Our production Python (/opt/local/bin/python) was compiled without debug symbols. Desperate at one point to step through the interpreter's C code, I built

[code-quality] Problems running pylint 1.4.0

2014-11-25 Thread Skip Montanaro
understanding. Can someone give me some suggestions about what's missing? Thanks, Skip Montanaro ___ code-quality mailing list code-quality@python.org https://mail.python.org/mailman/listinfo/code-quality

[code-quality] Fwd: The doc demo have some problems

2014-11-21 Thread Skip Montanaro
The appended email crossed the transom at webmas...@python.org today. Apologies for the hot mess Gmail makes of forwarded emails. I wonder if it makes sense to warn about misspelled dunder names. I tried pylinting (1.1.0, sorry, it's what I have here at work) and flake8ing (2.0) this: class Foo(o

Re: [code-quality] pylint for cython?

2014-09-12 Thread Skip Montanaro
On Fri, Sep 12, 2014 at 1:38 PM, Skip Montanaro wrote: > My make targets are map pyd files to so instead of pyx to so? s/pyd/pxd/ s/are// ___ code-quality mailing list code-quality@python.org https://mail.python.org/mailman/listinfo/code-quality

Re: [code-quality] pylint for cython?

2014-09-12 Thread Skip Montanaro
On Fri, Sep 12, 2014 at 12:25 PM, Mike Müller wrote: > You should try pure Python mode: > http://docs.cython.org/src/tutorial/pure.html > So I leave my Python code as-is in somemodule.py and put the Cython declarations in somemodule.pyd. My make targets are map pyd files to so instead of pyx to

[code-quality] pylint for cython?

2014-09-12 Thread Skip Montanaro
I have slowly been converting some Python source to Cython. I'm pretty conservative in what changes I make, mostly sprinkling a few "cdef", "float" and "int" declarations around the pyx file. Still, conservative or not, it's enough to choke pylint. Rather than have to maintain a pure Python version

Re: [code-quality] Request For Comments: Moving Flake8 development to Git

2014-09-12 Thread Skip Montanaro
On Fri, Sep 12, 2014 at 7:35 AM, Ian Cordasco wrote: > I was actually wondering if we should just keep it on BitBucket but convert > it to git. This would allow the URL to remain the same so people will not be > misled to the old repository. I had exactly this problem with pylockfile. Both for fi

Re: [code-quality] Alerting to unused module globals, instance attributes, etc?

2014-04-23 Thread Skip Montanaro
On Wed, Apr 23, 2014 at 9:28 AM, Phil Frost wrote: > Rather than make guesses that are right 90% of the time and yield 10% > false positives, pyflakes takes the PEP 20 approach: ... > It is the opinion of pyflakes that determining the correctness of your > program in such complex situations is bet

[code-quality] Alerting to unused module globals, instance attributes, etc?

2014-04-23 Thread Skip Montanaro
If I write a standalong script/program, it looks just like a module to the outside world (as long as I name it correctly), though it might have a #! line at the top. Otherwise, to a static analyzer, it still looks like a module, which means anything it defines might be visible from the outside. Con

Re: [code-quality] Warning from pylint about its own code?

2014-04-01 Thread Skip Montanaro
> Lately, whenever I run pylint, I get this warning: > > /opt/local/lib/python2.7/site-packages/pylint/reporters/text.py:79: > UserWarning: parseable output format is deprecated. This is equivalent > to --msg-template={path}:{line}: [{msg_id}({symbol}), {obj}] {msg} > 'to --msg-template=%s' % (se

[code-quality] Warning from pylint about its own code?

2014-04-01 Thread Skip Montanaro
Lately, whenever I run pylint, I get this warning: /opt/local/lib/python2.7/site-packages/pylint/reporters/text.py:79: UserWarning: parseable output format is deprecated. This is equivalent to --msg-template={path}:{line}: [{msg_id}({symbol}), {obj}] {msg} 'to --msg-template=%s' % (self.name, se

Re: [code-quality] Making git and pylint interact

2014-03-19 Thread Skip Montanaro
> I'm not entirely satisfied yet, > and if anybody has anything further to add, I'm still interested. My thinking is that if the code differences don't tell you what changes in pylint output are important, then maybe either * pylint results should be stored under version control so you can diff t

Re: [code-quality] __len__ but no __getitem__

2013-09-23 Thread Skip Montanaro
> Several times I've implemented classes with dynamic behaviour in > __getitem__, so they have no strict length (beyond "theoretically > infinite"). Understood, and that's a case where I think you should suppress the warning. I believe the common case is that if you can get a particular item you c

Re: [code-quality] __len__ but no __getitem__

2013-09-23 Thread Skip Montanaro
>> Should pylint really be this strict? Or am I expected to implement >> everything necessary for an array-like containiner and just raise >> exceptions in those methods the user really shouldn't access? > > No I'ld say you're right. While it sounded a good idea when proposed, you're > not > the f

[code-quality] __len__ but no __getitem__

2013-09-23 Thread Skip Montanaro
Having demonstrated my confusion about early breaks from loops, I will proceed to demonstrate my confusion about containers. I have a queue-like class in which I implement __len__ but not __getitem__. Pylint complains: timeddata.py:79: [R0924(incomplete-protocol), TimedDataQueue] Badly implemente

[code-quality] Fwd: Spurious useless-else-on-loop warning

2013-09-17 Thread Skip Montanaro
Ned, I still think you're missing the point of my original post. A return is as good as a break when considering early exit from a loop. The pylint code only checks for the presence of a break statement, but the test cases clearly show a case with a return statement. The test functions even includ

[code-quality] Fwd: Spurious useless-else-on-loop warning

2013-09-17 Thread Skip Montanaro
> But this "else" is useless, isn't it? Just put the "return dt" statement > after the for statement, no else needed. In this particular case, yes, but that's not the point of the post. Pylint doesn't check to see what's in the else clause, only whether there is an early exit from the body of th

[code-quality] Spurious useless-else-on-loop warning

2013-09-17 Thread Skip Montanaro
I have a function which uses for ... else, with an early return. Here's a cut down version of it: """...""" def func(c, dt, ct): for cl, op in zip(c.events[0::2], c.events[1::2]): delta = cl.event_datetime - dt if delta > ct: return dt + ct else:

Re: [code-quality] Extending pylint to deal with template variables?

2013-08-30 Thread Skip Montanaro
Note that this isn't peculiar to the say module. You can generate these false positives with dict format expansions in Python without using an external module. For instance: x = 4 print("%(x)s" % locals()) Pylint can't tell that x is used because it's use is buried in the format string. I have

Re: [code-quality] logilab-common 0.60

2013-08-27 Thread Skip Montanaro
> > % hg paths > > default = https://bitbucket.org/logilab/logilab-common > > Humm, it seems that we're missing auto-synchronisation to bitbucket. The > "central" repository is http://hg.logilab.org/master/logilab/common. I've pushed > to bitbucket though, until this is done automatically. Thanks.

Re: [code-quality] logilab-common 0.60

2013-08-26 Thread Skip Montanaro
> This is solved right? logilab-common 0.60 was actually released but missing > from pypi. Not in my mind. I'm working from the Mercurial repository. The stable branch declares its version to be 0.58.2. The default branch declares 0.58.0. Here are my current revisions: % hg branches stable

Re: [code-quality] Problems installing pylint 1.0

2013-08-26 Thread Skip Montanaro
> I'm coming back from holidays today. Do you still have the problem described > below? Anyway, it's not clear to me how it relates to pylint itself. I think I'm set. I don't recall now what the resolution was, but I got past that sticking point. Skip

Re: [code-quality] astroid and logilab-common still disagree about versions

2013-08-21 Thread Skip Montanaro
> I reported a couple weeks ago about astroid demanding logilab-common > >= 0.60, while the latest stable branch of logilab-common insists that > the latest version is just 0.58.2. > > So, I'm kind of stuck, looking for a "correct" solution here. I finally just punted, and replaced (0, 58, 2)

[code-quality] astroid and logilab-common still disagree about versions

2013-08-13 Thread Skip Montanaro
I reported a couple weeks ago about astroid demanding logilab-common >= 0.60, while the latest stable branch of logilab-common insists that the latest version is just 0.58.2. I trying "hg pull ; hg update" on both repos just now and find the situation hasn't changed. I am updated to the stable br

Re: [code-quality] logilab-common 0.60

2013-08-06 Thread Skip Montanaro
> FTR, this wasn't setuptools (distutils doesn't do requirements) fault. > The astroid 1.0.0 release is apparently broken. You shouldn't use software > with bugs. ;) Thanks for the advice. :-) My original pylint install problems were due to hurdles placed there by distutils. Once I worked aroun

[code-quality] logilab-common 0.60

2013-08-06 Thread Skip Montanaro
I figured out my pylint install woes (I really dislike distutils). Then I needed a newer version of astroid. Picked up the latest, which was also 1.0.0. That, alas, requires logilab-common >= 0.60.0, which has yet to be released. Even the latest mercurial stuff only provides 0.58.x. Where have I

[code-quality] Problems installing pylint 1.0

2013-08-06 Thread Skip Montanaro
I'm trying to package up pylint 1.0 for our local installation. For the most part, the simple tar archive seems ideal, however the path components in the generated tar file have an unwanted prefix. Our Python installation is in /opt/TWWfsw/python27, so ./opt/TWWfsw/python27 appears as a prefix to

[code-quality] More complete Bitbucket mails?

2013-07-17 Thread Skip Montanaro
Is there some way to get Bitbucket to give me more information in its emails? I only have decent access at the moment to email. All I get are "approved" or "declined" mails with links, no comments the submitter might have included. Thx, Skip ___ code-qu

Re: [code-quality] Adding new warnings?

2013-07-07 Thread Skip Montanaro
> Aside from Marius's point about the typo, you also need to make sure it is > added to the @check_messages decorator. Thanks. I would never have guessed that. Looking in checkers/classes.py, I see 22 messages defined in the MSGS dict, but only two are mentioned, in a single use of the check_mes

Re: [code-quality] Adding new warnings?

2013-07-06 Thread Skip Montanaro
> So is it 2-3-4, or 3-2-4? : dope slap: Thanks, Skip ___ code-quality mailing list code-quality@python.org http://mail.python.org/mailman/listinfo/code-quality

[code-quality] Adding new warnings?

2013-07-05 Thread Skip Montanaro
Is there some magic to adding new messages to pylint? I've defined my new warning in checkers/classes.py by adding a new key/value pair to the MSGS dict: MSGS = { ... 'W0234': ('instance attribute %r is not used within the class', 'defined-attribute-not-accessed',

Re: [code-quality] pylint unit tests?

2013-07-04 Thread Skip Montanaro
>> How should PYTHONPATH be set? How would I get a pytest command in my >> checkout? > > You should ensure that when you "import pylint", pylint.__path__ point to your > checkout directory (or wherever you do your own modifications). Thanks for the extra help. Making this work required a bit of

Re: [code-quality] pylint unit tests?

2013-07-04 Thread Skip Montanaro
> * Are you sure that PYTHONPATH is set properly so that your checkout of pylint > is used to run the test? The second trace you provide tends to make me think > there is a problem here. PYTHONPATH is unset. I don't recall seeing any instructions about setting it in contribute.rst. I have be

Re: [code-quality] pylint unit tests?

2013-07-03 Thread Skip Montanaro
On Wed, Jul 3, 2013 at 5:57 PM, Martin Pool wrote: > They pass for me on Linux. It does not seem like the kind of thing that > would be very platform-specific. Thanks. I tried to back out my local changes but eventually gave up, not really understanding how this stuff works in Mercurial. I woun

[code-quality] pylint unit tests?

2013-07-03 Thread Skip Montanaro
I'm struggling trying to get a clean test run in my local pylint repo. At the moment, I have one small checker function, whose call I have commented out, and have reverted all edits to the test inputs. When I run ./fulltest.sh 2.7 on my Mac, I get a lot of output, ending with this: Ran 528 tes

[code-quality] Pylint - missing module docstring for __init__.py

2013-07-02 Thread Skip Montanaro
This warning seems specious: __init__.py:1: [C0111] Missing module docstring especially since __init__.py is often empty (as it is in this case), being used only as a marker that a directory is actually a package. This is in Python 2.7. I'm doing nothing to override the docstring_min_length conf

[code-quality] Unsure how to change tests when adding new checker

2013-06-21 Thread Skip Montanaro
I'm working on a new class checker which complains about attributes which are defined but not used within the class. This check triggers all sorts of warnings throughout the test suite. What do I do? Lots of expected output will have to be changed. Thx, Skip ___

Re: [code-quality] Two attribute usage checkers I'd like to see

2013-06-20 Thread Skip Montanaro
> I cloned logilab-common, pylint and astroid. Installed in ~/.local, > then tried pylint with PYTHONPATH set, but no command line args. No > luck: > ... > pkg_resources.DistributionNotFound: logilab-astroid>=0.24.3 I believe I have this figured out. Pylint appears to be requiring a package nam

Re: [code-quality] Two attribute usage checkers I'd like to see

2013-06-20 Thread Skip Montanaro
> There is an unused-variable message in the variables checker > (pylint/checkers/variables.py). > This is probably worth reading indeed, though in this particular case in > should rather > go in the classes checker (pylint/checkers/classes.py). Thanks for the pointer. I think I have a notion of

Re: [code-quality] Two attribute usage checkers I'd like to see

2013-06-19 Thread Skip Montanaro
On Wed, Jun 19, 2013 at 2:37 AM, Sylvain Thénault wrote: > On 07 juin 09:18, Martin Pool wrote: >> On 7 June 2013 06:49, Skip Montanaro wrote: >> >> > If I never refer to self.x or self.y within the class's methods it >> > would be nice to be alerted. >

Re: [code-quality] Two attribute usage checkers I'd like to see

2013-06-06 Thread Skip Montanaro
>> Here's the other problem I'd like to catch: >> class X(object): >> ... >> def get_foo(self): >> return self._foo >> foo = property(get_foo) >> The problem here is that I have violated this Zen of Python dictum: >> There should be one-- and preferably o

[code-quality] Two attribute usage checkers I'd like to see

2013-06-06 Thread Skip Montanaro
These features may already be possible with some tools. If so, pointers appreciated. When a class evolves over a long period of time, it's quite possible for methods or data attributes to fall into disuse. While I realize that attributes which don't start with an underscore are implicitly part o