Nick Coghlan <ncogh...@gmail.com> added the comment:

Completely unrelated to the topic at hand, but that command line can be
written more concisely as:

E:\Python26\python.exe -m pychecker.checker test.py 

(pychecker was actually the number 1 use case when it came to justifying
the expansion of -m to modules inside packages)

As for the actual topic of the bug report... using 't' for tuple
(instead of the more common 'self') seems like a perfectly reasonable
name for the first argument to _asdict(). Expanding it to 'self' doesn't
really improve readability all that much - it just makes the self
references take up more visual space relative to the attribute names.

def _asdict(self):
  'Return a new dict which maps field names to their values'
  return {'id': self[0], 'date': self[1], 'name': self[2], 'desc': self
[3]}

Pychecker and friends are probably going to want to recognise namedtuple
instances and silence this warning by default anyway (since even if it
does get changed, there will still be plenty of Python installations out
there which will still generate the warning).

----------
nosy: +ncoghlan

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue5336>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to