Feature or enhancement
Proposal:
Remove the unused tokenize._compile function. EDIT: Deprecate the unused tokenize._compile function.
It very much looks like the internal tokenize._compile function hasn't been needed since GH-104323 when it was initially removed, but it was mechanically brought back to tokenize in GH-104722 to fix GH-104719.
From a quick search, it seems that, prior to GH-104323, tokenize._compile was only used internally in tokenize._tokenize.
Most of the fairly fresh code I skimmed through on GitHub operating on tokenize._compile properly checks if Python is version <3.10 / tokenize._compile exists.
Except CheetahTemplate3, so removing tokenize._compile immediately could break them -- we need to deprecate first.
In terms of benefits of removing this at some point: it wouldn't necessarily improve the import time of tokenize as long as re still imports functools to cache template compilation. Therefore, removing tokenize._compile in the future is just a small cleanup that yields no other benefits than smaller, less bloated code.
Has this already been discussed elsewhere?
This is a minor feature, which does not need previous discussion elsewhere
Links to previous discussion of this feature:
No response
Feature or enhancement
Proposal:
Remove the unusedEDIT: Deprecate the unusedtokenize._compilefunction.tokenize._compilefunction.It very much looks like the internal
tokenize._compilefunction hasn't been needed since GH-104323 when it was initially removed, but it was mechanically brought back totokenizein GH-104722 to fix GH-104719.From a quick search, it seems that, prior to GH-104323,
tokenize._compilewas only used internally intokenize._tokenize.Most of the fairly fresh code I skimmed through on GitHub operating on
tokenize._compileproperly checks if Python is version <3.10 /tokenize._compileexists.Except
CheetahTemplate3, so removingtokenize._compileimmediately could break them -- we need to deprecate first.In terms of benefits of removing this at some point: it wouldn't necessarily improve the import time of
tokenizeas long asrestill importsfunctoolsto cache template compilation. Therefore, removingtokenize._compilein the future is just a small cleanup that yields no other benefits than smaller, less bloated code.Has this already been discussed elsewhere?
This is a minor feature, which does not need previous discussion elsewhere
Links to previous discussion of this feature:
No response