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

gh-149313: Preserve exception notes/cause in dict/set unhashable type… by anujbharambe · Pull Request #149505 · python/cpython · GitHub

/ cpython Public

gh-149313: Preserve exception notes/cause in dict/set unhashable type… - #149505

Open
anujbharambe wants to merge 2 commits into
python:mainfrom
anujbharambe:fix-unhashable-exception-chaining
Open

gh-149313: Preserve exception notes/cause in dict/set unhashable type…#149505
anujbharambe wants to merge 2 commits into
python:mainfrom
anujbharambe:fix-unhashable-exception-chaining

Conversation

anujbharambe commented May 7, 2026
edited by bedevere-app Bot
Loading

Copy link
Copy Markdown
Contributor

Summary

Chain the original TypeError as __cause__ and __context__ on the new exception in dict_unhashable_type() and set_unhashable_type(). This preserves __notes__, __traceback__, and any existing cause chain that were previously discarded when the improved error message was created.

Fixes #149313
Some parts of this PR were written with the assistance of Claude (AI).

Copy link
Copy Markdown
Member

Updating to fix some errors we introduced on the main branch.

Copy link
Copy Markdown

This PR is stale because it has been open for 90 days with no activity.

github-actions Bot added the stale Stale PR or inactive for long period of time. label Aug 10, 2026
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

Labels

awaiting review stale Stale PR or inactive for long period of time.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Exception notes discarded from TypeError within __hash__()

3 participants


Back | FazBrowse Home | New Git URL