fix: surface Python 3.10+ NameError/AttributeError suggestions in REPL#15227
Draft
Aanushka001 wants to merge 5 commits into
Draft
fix: surface Python 3.10+ NameError/AttributeError suggestions in REPL#15227Aanushka001 wants to merge 5 commits into
Aanushka001 wants to merge 5 commits into
Conversation
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
f88a35f to
2261300
Compare
…ready contains a suggestion
Author
|
temp |
Author
|
Hi maintainers! 👋 I just wanted to gently follow up on this PR — it's been open for a few days now and I haven't seen any activity yet. Would love to get some feedback when anyone has a chance to look it over. Thanks! |
Member
|
Maintainer(s) is mostly me, your PR has a bunch of typoes and unrelated changes that would need to be undone before even starting to look at it. Marking as draft until done. |
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds support for Python 3.10+'s "Did you mean...?" suggestions for
NameErrorandAttributeErrorexceptions in IPython's REPL traceback formatting.Changes
get_suggestions()method toVerboseTBinIPython/core/ultratb.pythat captures Python 3.10+ suggestion hints usingsys.__excepthook__withredirect_stderrformat_exception_as_a_whole()to include the suggestion text in the formatted output with proper themingNameError/AttributeErrorexceptions on Python 3.10+ and uses the__excepthook__to generate suggestions, parsing the stderr output for "Did you mean" linesCloses #13445