Skip to content

Conversation

@reteps
Copy link

@reteps reteps commented Feb 10, 2026

Summary

  • Adds a hide parameter to Traceback, Traceback.from_exception(), install(), and Console.print_exception()
  • Like suppress (which dims frames and hides source), hide removes matching frames entirely from the output
  • Uses the same path-matching pattern as suppress for consistency

Test plan

  • test_hide: Verifies storage of modules and string paths (mirrors test_suppress)
  • test_hide_removes_frames: Verifies hidden frames are absent from output while exception type is preserved
  • All existing traceback tests pass
  • mypy strict mode passes
  • black formatting clean

🤖 Generated with Claude Code

Unlike suppress (which dims frames and hides source but keeps the frame
header), hide removes matching frames entirely from the output. Uses the
same path-matching pattern as suppress for consistency.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@reteps
Copy link
Author

reteps commented Feb 10, 2026

I did not see any policy for AI-assisted contributions, but please let me know if I should close this. This is a feature I monkey-patched for my own needs I thought might be useful to others, so I am upstreaming it. Thanks!

@reteps reteps marked this pull request as ready for review February 10, 2026 19:49
@reteps
Copy link
Author

reteps commented Feb 10, 2026

In my case, I have several pieces of internal code I don't want users to have to sift through / be aware of.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant