FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-113744: Add a new IncompleteInputError exception to improve incomplete input detection in the codeop module by pablogsal · Pull Request #113745 · python/cpython · GitHub

Repository navigation

gh-113744: Add a new IncompleteInputError exception to improve incomplete input detection in the codeop module - #113745

Merged
pablogsal merged 2 commits into
python:mainfrom
pablogsal:incomplete
Jan 30, 2024
Merged

pablogsal merged 2 commits into
python:mainfrom
pablogsal:incomplete

Conversation

pablogsal commented Jan 5, 2024 •
edited by bedevere-app Bot
Loading

Copy link
Copy Markdown
Member

lysnikolaou left a comment •
edited
Loading

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM! Something needs to be regenerated.

Comment thread Lib/_compat_pickle.py Outdated
…incomplete input detection in the codeop module

Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
pablogsal enabled auto-merge (squash) January 30, 2024 15:04

serhiy-storchaka left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM.

I am not sure about the name. On one hand, it looks correct and I do not have anything better, on other hand, it can be confused with the use case for BlockingIOError. In future we can see misuse of this error in cases not related to parsing Python sources. Not sure if it's something to worry about.

Copy link
Copy Markdown
Member Author

I am not sure about the name. On one hand, it looks correct and I do not have anything better, on other hand, it can be confused with the use case for BlockingIOError. In future we can see misuse of this error in cases not related to parsing Python sources. Not sure if it's something to worry about.

I don't think we should worry about it because it's not user facing (at least for now). It's used internally in a special mode of the parser that's also not user facing. And in the rare case where a user encounters it it's relatively easy to identify why is appearing.

…mprove incomplete input detection in the codeop module

Signed-off-by: Pablo Galindo <pablogsal@gmail.com>

encukou commented Jan 30, 2024

Copy link
Copy Markdown
Member

Let's not add it to the stable ABI, then?

pablogsal merged commit 39d102c into python:main Jan 30, 2024
pablogsal deleted the incomplete branch January 30, 2024 16:21

Copy link
Copy Markdown
Member Author

Let's not add it to the stable ABI, then?

Sorry @encukou but seems that the auto-land landed it before I could tackle your comment. Do you want to remove it from the stable ABI? The name is public in any case so it would be weird if is not there but you can invoke it from builtins

Copy link
Copy Markdown
Member

If it is used internally in a special mode of the parser, it could be not added to buildins. But I do not see how this mode is special. It does not use any magic flags or private arguments. I expect it to be used in many third-party REPL implementations. And maybe even in the C code. So it is okay to make it as public as other SyntaxError subclasses.

encukou commented Jan 31, 2024

Copy link
Copy Markdown
Member

I don't think we should worry about [the name] because it's not user facing (at least for now).

Adding it to the public C API (and especially to the stable ABI) means that it is user facing, and now is the time to worry about the name.
If there is a chance we'll find a better way, and we'll need to deprecate/remove this, it shouldn't go it the stable ABI.

TBH, the name is fine with me. IncompleteSourceError might be more descriptive.

aisk pushed a commit to aisk/cpython that referenced this pull request Feb 11, 2024
…incomplete input detection in the codeop module (python#113745)

Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants


Back | FazBrowse Home | New Git URL