Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-104719: Restore Tokenize module constants#104722

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
pablogsal merged 1 commit intopython:mainfrommgmacias95:restore_tokenize
May 21, 2023

Conversation

@mgmacias95
Copy link
Contributor

@mgmacias95mgmacias95 commentedMay 21, 2023
edited by bedevere-bot
Loading

@AlexWaygood
Copy link
Member

I was wondering if you could do something like this:

_deprecated_objects= {"group":lambda*choices:'('+'|'.join(choices)+')',"any":lambda*choices:group(*choices)+'*',"maybe":lambda*choices:group(*choices)+'?',"Whitespace":r'[ \f\t]*',# etc.}

And then at the end of the file have:

def__getattr__(name):ifnamein_deprecated_objects:importwarningswarnings._deprecated(f"tokenize.{name}",message=("{name} is untested, undocumented, and deprecated. ""It will be removed in Python {remove}."            ),remove=(3,14)        )obj=globals()[name]=_deprecated_objects[name]returnobjraiseAttributeError(f"module 'tokenize' has no attribute '{name}'")

But I will defer to you and@pablogsal as to whether that's a good idea or not.

@AlexWaygood
Copy link
Member

Looks like this does fix the immediate issue, though -- IDLE is once again able to open.py files 🎉

@pablogsal
Copy link
Member

pablogsal commentedMay 21, 2023
edited
Loading

But I will defer to you and@pablogsal as to whether that's a good idea or not.

For the time being, let's just scope this PR to restoring the constants and let's keep the discussion open in the main issue. Also, let's wait until@Yhg1s mentions what he would prefer. Among other things I can imagine an outcome when we promote these to public interface.

AlexWaygood reacted with thumbs up emoji

@AlexWaygood
Copy link
Member

For the time being, let's just scope this PR to restoring the constants and let's keep the discussion open in the main issue. Also, let's wait until@Yhg1s mentions what he would prefer. Among other things I can imagine an outcome when we promote these to public interface.

SGTM.

@mgmacias95mgmacias95 deleted the restore_tokenize branchMay 21, 2023 16:11
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@pablogsalpablogsalpablogsal approved these changes

Assignees

No one assigned

Labels

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

4 participants

@mgmacias95@AlexWaygood@pablogsal@bedevere-bot

[8]ページ先頭

©2009-2025 Movatter.jp