Skip to content
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

Consider not consuming all the buffer in one go in the tokenizer module #105069

Closed
pablogsal opened this issue May 29, 2023 · 1 comment
Closed

Comments

@pablogsal
Copy link
Member

pablogsal commented May 29, 2023

Seems that some tools were relying on the implementation detail that the readline-like callable that is provided to functions in the tokenize module is called as tokens are emitted and not consumed in one go. Although this was never part of the contract and technically we don't need to change, it would make the implementation more efficient as we don't need to hold the entire input in memory at the same time and we won't break these tools.

Linked PRs

@pablogsal
Copy link
Member Author

CC: @lysnikolaou @mgmacias95

pablogsal added a commit to pablogsal/cpython that referenced this issue May 29, 2023
pablogsal added a commit to pablogsal/cpython that referenced this issue May 29, 2023
…sume input iteratively

Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
pablogsal added a commit to pablogsal/cpython that referenced this issue May 29, 2023
…sume input iteratively

Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
pablogsal added a commit to pablogsal/cpython that referenced this issue May 29, 2023
…sume input iteratively

Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
pablogsal added a commit to pablogsal/cpython that referenced this issue May 29, 2023
…sume input iteratively

Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
pablogsal added a commit to pablogsal/cpython that referenced this issue May 29, 2023
…sume input iteratively

Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
pablogsal added a commit to pablogsal/cpython that referenced this issue May 29, 2023
…sume input iteratively

Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
pablogsal added a commit to pablogsal/cpython that referenced this issue May 29, 2023
…sume input iteratively

Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
pablogsal added a commit to pablogsal/cpython that referenced this issue May 29, 2023
pablogsal added a commit to pablogsal/cpython that referenced this issue May 30, 2023
pablogsal added a commit to pablogsal/cpython that referenced this issue May 30, 2023
… the tokenizer to consume input iteratively
pablogsal added a commit to pablogsal/cpython that referenced this issue May 30, 2023
…able to the tokenizer to consume input iteratively
pablogsal added a commit to pablogsal/cpython that referenced this issue May 30, 2023
…ke callable to the tokenizer to consume input iteratively
pablogsal added a commit to pablogsal/cpython that referenced this issue May 30, 2023
…line-like callable to the tokenizer to consume input iteratively
miss-islington pushed a commit to miss-islington/cpython that referenced this issue May 30, 2023
…sume input iteratively (pythonGH-105070)

(cherry picked from commit 9216e69)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
pablogsal added a commit that referenced this issue May 31, 2023
…nsume input iteratively (GH-105070) (#105119)

gh-105069: Add a readline-like callable to the tokenizer to consume input iteratively (GH-105070)
(cherry picked from commit 9216e69)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant