This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: except* assumes that an exception group is truthy
Type: behavior Stage: resolved
Components: Interpreter Core Versions: Python 3.11
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: brandtbucher, iritkatriel, veky
Priority: normal Keywords: patch

Created on 2022-01-01 10:42 by iritkatriel, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 30289 merged iritkatriel, 2022-01-01 14:03
Messages (4)
msg409454 - (view) Author: Irit Katriel (iritkatriel) * (Python committer) Date: 2022-01-01 10:42
except* checks truthiness of the output of PREP_RERAISE_STAR, and this gives the wrong result for false ExceptionGroup subclasses. See
https://github.com/python/cpython/pull/30302#discussion_r776825568
msg409460 - (view) Author: Irit Katriel (iritkatriel) * (Python committer) Date: 2022-01-01 14:27
... "for falsy ExceptionGroup subclasses"
msg409498 - (view) Author: Vedran Čačić (veky) * Date: 2022-01-02 14:46
A long time ago, Python documentation used true and false as adjectives (as opposed to True and False, which are proper names for canonical true/false objects). I think it was BDFL's preference back then.

In the meantime, I suppose through JS's influence, Python documentation started to adopt ancient Perl terminology, where truhy and falsy were used as adjectives standing for what was previously known as true and false. I really don't like it, and I think English language is clear enough here (given the help of code font and capital letter) that we don't need to invent new words. Of course, it is up to the community to decide (and maybe the steering council might issue an opinion), but I'm telling you the history and my preference.
msg409540 - (view) Author: Irit Katriel (iritkatriel) * (Python committer) Date: 2022-01-02 23:22
New changeset 65e7c1f90e9136fc61f4af029b065d9f6c5664c3 by Irit Katriel in branch 'main':
bpo-46219, 46221: simplify except* implementation following exc_info changes. Move helpers to exceptions.c. Do not assume that exception groups are truthy. (GH-30289)
https://github.com/python/cpython/commit/65e7c1f90e9136fc61f4af029b065d9f6c5664c3
History
Date User Action Args
2022-04-11 14:59:54adminsetgithub: 90377
2022-01-02 23:23:19iritkatrielsetstatus: open -> closed
type: behavior
resolution: fixed
stage: patch review -> resolved
2022-01-02 23:22:46iritkatrielsetmessages: + msg409540
2022-01-02 14:46:27vekysetnosy: + veky
messages: + msg409498
2022-01-01 14:27:27iritkatrielsetmessages: + msg409460
2022-01-01 14:03:04iritkatrielsetkeywords: + patch
stage: patch review
pull_requests: + pull_request28538
2022-01-01 10:43:01iritkatrielsettitle: except* assumes that an exception group is truth -> except* assumes that an exception group is truthy
2022-01-01 10:42:47iritkatrielcreate