[issue5857] Return namedtuples from tokenize token generator

2021-03-11 Thread Sergei Lebedev
Sergei Lebedev added the comment: > I strongly prefer that there not be inner named tuples. Hi Raymond, do you still strongly prefer (row, col) to remain unnamed? If so, could you comment on what makes you prefer that apart from (row, col) being more common than (col, row)? Are there any

[issue5857] Return namedtuples from tokenize token generator

2009-04-28 Thread Georg Brandl
Georg Brandl ge...@python.org added the comment: Note that in tokenize.diff, TokenInfo should be in __all__ instead of Token. I agree with Raymond on the inner tuples. -- nosy: +georg.brandl ___ Python tracker rep...@bugs.python.org

[issue5857] Return namedtuples from tokenize token generator

2009-04-28 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: Committed in r72086. Needs backporting to 2.7. -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5857

[issue5857] Return namedtuples from tokenize token generator

2009-04-27 Thread Vaibhav Mallya
New submission from Vaibhav Mallya mally...@umich.edu: Returning an anonymous 5-tuple seems like a suboptimal interface since it's so easy to accidentally confuse, for example, the indices of start and end. I've used tokenize.py for several scripts in the past few weeks and I've always ended up

[issue5857] Return namedtuples from tokenize token generator

2009-04-27 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: Comments on the earlier patch: * No need for an inner row/col namedtuple. That would add little value. * The name Token is already used in the module for a different purpose. * The wrapper is nice looking, but it is better to

[issue5857] Return namedtuples from tokenize token generator

2009-04-27 Thread Vaibhav Mallya
Vaibhav Mallya mally...@umich.edu added the comment: Well, the reason I put in the inner row/col namedtuple initially was because the first mistake I made with the original module was mixing up the row/col indices for a particular case. It certainly caused all sorts of weird headaches. :o) I

[issue5857] Return namedtuples from tokenize token generator

2009-04-27 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: I strongly prefer that there not be inner named tuples. That is going overboard. FWIW, row/col order is very common convention especially when the row refers to a line number in a text block and column refers to a character

[issue5857] Return namedtuples from tokenize token generator

2009-04-27 Thread Raymond Hettinger
Changes by Raymond Hettinger rhettin...@users.sourceforge.net: -- assignee: - rhettinger ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5857 ___