New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Return namedtuples from tokenize token generator #50107
Comments
Returning an anonymous 5-tuple seems like a suboptimal interface since I'd like to propose the following patch that simply decorates the next_token.type If this seems like a reasonable way to do things, I'd be happy to submit |
Comments on the earlier patch:
Attaching an alternate patch. |
Well, the reason I put in the inner row/col namedtuple initially was I mean, it seems like there's no real reason it "should" be (row,col) I really feel that allowing for start.row and start.col would make the Agreed with the other two points, however. Also, I take it there's going to be a need for an addendum to the test |
I strongly prefer that there not be inner named tuples. That is going |
Note that in tokenize.diff, "TokenInfo" should be in __all__ instead of |
Committed in r72086. |
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 performance implications/runtime costs associated with making it (row, col) a namedtuple? |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: