Uh oh!
There was an error while loading. Please reload this page.
gh-113744: Add a new IncompleteInputError exception to improve incomplete input detection in the codeop module - #113745
Conversation
Uh oh!
There was an error while loading. Please reload this page.
…incomplete input detection in the codeop module Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
serhiy-storchaka
left a comment
There was a problem hiding this comment.
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.
pablogsal
commented
Jan 30, 2024
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
Let's not add it to the stable ABI, then? |
pablogsal
commented
Jan 30, 2024
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 |
serhiy-storchaka
commented
Jan 30, 2024
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
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. TBH, the name is fine with me. |
…incomplete input detection in the codeop module (python#113745) Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
Uh oh!
There was an error while loading. Please reload this page.