You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
BaseExceptionGroup.split() and subgroup() keep the __traceback__ that derive() set when the original group has none #162455
The docs say subgroup() and split() copy the __traceback__, __cause__, __context__ and __notes__ fields from the original group to the one returned by derive(), "so these fields do not need to be updated by derive". When the original group has no traceback, though, the traceback isn't copied, so the result keeps whatever traceback derive() gave it:
This prints True False False; going by the docs it should print True True True. In exceptiongroup_subset (Objects/exceptions.c) the traceback is only set if (tb), while __context__ and __cause__ are set even when they are None. I found it while writing a Lean spec of Python. PyPy 3.12 prints True True True.
Activity