msg252848 - (view) |
Author: Xiang Zhang (xiang.zhang) * |
Date: 2015-10-12 08:11 |
In the first paragraph of https://docs.python.org/3/extending/extending.html#intermezzo-errors-and-exceptions,
it is wrong to use the sentence "the second argument to raise" since
the raise syntax has been changed in Python3.
|
msg252858 - (view) |
Author: R. David Murray (r.david.murray) * |
Date: 2015-10-12 15:17 |
Looks good to me.
|
msg252859 - (view) |
Author: R. David Murray (r.david.murray) * |
Date: 2015-10-12 15:21 |
Actually, I take that back. Shouldn't it be "the object passed *as* the exception object to raise?
|
msg252866 - (view) |
Author: Xiang Zhang (xiang.zhang) * |
Date: 2015-10-12 15:49 |
With this sentence
A second global variable stores the “associated value” of the exception (the second argument to raise).
I think the phrase inside the parentheses is to explain the "associated value", which is usually a string passed to the exception object, not the exception object itself.
Do I misunderstand anything?
|
msg252867 - (view) |
Author: R. David Murray (r.david.murray) * |
Date: 2015-10-12 15:57 |
Yes. The second element of the sys.exc_info result is the exception instance, not the argument to the exception constructor. The old raise syntax allowed you to specify the exception instance as the second argument to raise, but if you specified a string it converted it to an exception instance using the first argument as the constructor to call. So, the 2.7 docs aren't entirely accurate, since it isn't the second argument to raise that is stored, but the object that results from raise *processing* its second argument.
|
msg252871 - (view) |
Author: Xiang Zhang (xiang.zhang) * |
Date: 2015-10-12 16:34 |
Oops, I misunderstand sys.exc_info all the time, sad :(
Now, both versions of doc are not correct. Please make them fixed.
|
msg252907 - (view) |
Author: Xiang Zhang (xiang.zhang) * |
Date: 2015-10-13 03:18 |
I fix my patch with David's comment.
|
msg252913 - (view) |
Author: Martin Panter (martin.panter) * |
Date: 2015-10-13 05:07 |
“Associated value” still seems a bit weird. I wonder if it would be clearer to say
The exception type is stored in a static global variable . . . A second global variable stores the exception instance passed to :keyword:`raise` . . .
Also further down that section it looks like there are other problems. “Exception object” is perhaps actually a C object referencing the exception class (type). ‘Python string object . . . stored as the "associated value" ’ should perhaps be the exception instance (object). I think a long time ago Python may have actually worked this way, but not any more, and the whole section probably needs updating.
|
msg252917 - (view) |
Author: Xiang Zhang (xiang.zhang) * |
Date: 2015-10-13 05:38 |
Yes, you are right martin. It seems the whole chapter needs more updates, not only the bits I mentioned. I won't provide a new patch since I am not an English native and I am not sure I can provide an accurate and right description. Hope someone else may help.
|
msg252930 - (view) |
Author: R. David Murray (r.david.murray) * |
Date: 2015-10-13 13:20 |
There's also the fact that the argument to raise can be an exception class, but the second element of sys.exc_info is still an instance of that class, which only occurred to me while reading your revised patch.
|
msg252933 - (view) |
Author: Xiang Zhang (xiang.zhang) * |
Date: 2015-10-13 14:03 |
Actually what I intend is that the exception object passed to raise is the exception instance raise finally throws (what is stored in the second variable). So it seems wise not to do any more for me. A single sentence has lead to confusion, not to mention more.
|
msg396280 - (view) |
Author: Terry J. Reedy (terry.reedy) * |
Date: 2021-06-21 18:35 |
Irit, it is unclear why you unchecked 'patch'. Because no PR? The keyword includes a patch file attached to an issue. Someone can convert it to a PR. From the tracker doc:
"patch There is a patch or pull request attached to the issue."
Because the 2nd patch was, in essence rejected as is? A different matter, though most .patch or .diff files attached need revision when made a PR.
|
msg396291 - (view) |
Author: Terry J. Reedy (terry.reedy) * |
Date: 2021-06-21 21:25 |
On 2007 Aug 15, extending.rst was merged into master (early 2.6 alpha) and early 3.0 alpha. The only change to this paragraph since the initial 2.6 version was Serhiy changing "*NULL*" to "``NULL``" in 3.x on 2019 Oct 30. I will post a PR with what I think is true now.
|
msg396292 - (view) |
Author: Irit Katriel (iritkatriel) * |
Date: 2021-06-21 21:36 |
Yes, I thought since we need a PR the keyword was wrong. Thanks for the correction.
|
msg406364 - (view) |
Author: Carol Willing (willingc) * |
Date: 2021-11-15 22:39 |
New changeset ad43dc0b54994e7e7d06e3d4896ade188b36ee12 by Terry Jan Reedy in branch 'main':
bpo-25381: Update explanation of exceptions in C. (GH-26838)
https://github.com/python/cpython/commit/ad43dc0b54994e7e7d06e3d4896ade188b36ee12
|
msg406367 - (view) |
Author: Terry J. Reedy (terry.reedy) * |
Date: 2021-11-15 23:06 |
New changeset 0320cf1a250b025f2ef25637851384bf8b61d207 by Miss Islington (bot) in branch '3.10':
bpo-25381: Update explanation of exceptions in C. (GH-26838) (GH-29568)
https://github.com/python/cpython/commit/0320cf1a250b025f2ef25637851384bf8b61d207
|
msg406368 - (view) |
Author: Terry J. Reedy (terry.reedy) * |
Date: 2021-11-15 23:08 |
New changeset b0bdc093c2c15c352c5bede060117790705f5db0 by Miss Islington (bot) in branch '3.9':
bpo-25381: Update explanation of exceptions in C. (GH-26838) (GH-29569)
https://github.com/python/cpython/commit/b0bdc093c2c15c352c5bede060117790705f5db0
|
|
Date |
User |
Action |
Args |
2022-04-11 14:58:22 | admin | set | github: 69568 |
2021-11-15 23:08:42 | terry.reedy | set | status: open -> closed resolution: fixed stage: patch review -> resolved |
2021-11-15 23:08:01 | terry.reedy | set | messages:
+ msg406368 |
2021-11-15 23:06:49 | terry.reedy | set | messages:
+ msg406367 |
2021-11-15 22:39:04 | miss-islington | set | pull_requests:
+ pull_request27817 |
2021-11-15 22:39:00 | miss-islington | set | nosy:
+ miss-islington pull_requests:
+ pull_request27816
|
2021-11-15 22:39:00 | willingc | set | nosy:
+ willingc messages:
+ msg406364
|
2021-06-22 03:14:24 | terry.reedy | set | stage: needs patch -> patch review |
2021-06-22 02:53:19 | terry.reedy | set | title: Doc: Use of old description of raise in Python3 -> Update doc of three C exception values. stage: patch review -> needs patch |
2021-06-21 21:55:09 | terry.reedy | set | keywords:
+ patch stage: needs patch -> patch review pull_requests:
+ pull_request25419 |
2021-06-21 21:36:33 | iritkatriel | set | messages:
+ msg396292 |
2021-06-21 21:25:40 | terry.reedy | set | nosy:
+ iritkatriel
messages:
+ msg396291 versions:
+ Python 3.9, Python 3.10 |
2021-06-21 18:35:29 | terry.reedy | set | messages:
+ msg396280 |
2021-06-21 17:26:27 | iritkatriel | set | keywords:
- patch versions:
+ Python 3.11, - Python 3.5, Python 3.6 |
2016-01-04 03:36:12 | ezio.melotti | set | nosy:
+ ezio.melotti
type: enhancement versions:
- Python 3.4 |
2015-12-23 11:38:58 | jayvdb | set | nosy:
+ jayvdb
|
2015-10-17 01:23:07 | terry.reedy | set | nosy:
+ terry.reedy
|
2015-10-13 14:03:08 | xiang.zhang | set | messages:
+ msg252933 |
2015-10-13 13:20:22 | r.david.murray | set | messages:
+ msg252930 stage: patch review -> needs patch |
2015-10-13 05:38:44 | xiang.zhang | set | messages:
+ msg252917 |
2015-10-13 05:07:24 | martin.panter | set | nosy:
+ martin.panter messages:
+ msg252913
|
2015-10-13 03:18:14 | xiang.zhang | set | files:
+ doc_extending2.patch
messages:
+ msg252907 |
2015-10-12 16:34:17 | xiang.zhang | set | messages:
+ msg252871 |
2015-10-12 15:57:28 | r.david.murray | set | messages:
+ msg252867 |
2015-10-12 15:49:50 | xiang.zhang | set | messages:
+ msg252866 |
2015-10-12 15:22:58 | r.david.murray | set | stage: commit review -> patch review |
2015-10-12 15:21:20 | r.david.murray | set | messages:
+ msg252859 |
2015-10-12 15:17:04 | r.david.murray | set | nosy:
+ r.david.murray title: Doc: Use old description of raise in Python3 -> Doc: Use of old description of raise in Python3 messages:
+ msg252858
versions:
+ Python 3.4, Python 3.5, Python 3.6 stage: commit review |
2015-10-12 08:18:55 | vstinner | set | title: Use old description of raise in Python3 -> Doc: Use old description of raise in Python3 |
2015-10-12 08:11:36 | xiang.zhang | create | |