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.
Created on 2002年09月25日 18:17 by gvanrossum, last changed 2022年04月10日 16:05 by admin.
| Messages (7) | |||
|---|---|---|---|
| msg60274 - (view) | Author: Guido van Rossum (gvanrossum) * (Python committer) | Date: 2002年09月25日 18:17 | |
I really wish that KeyError, AttributeError, NameError and IndexError provided clean APIs for getting at the missing key, name, or index. (Suggested by Jim Fulton) |
|||
| msg60275 - (view) | Author: Martin v. Löwis (loewis) * (Python committer) | Date: 2002年09月26日 18:19 | |
Logged In: YES user_id=21627 For KeyError, isn't it e.args[0]? For the others, I suggest that args[0] is the string, args[1] is the parameter. As a result, those classes need a __str__ which returns args[0]. |
|||
| msg60276 - (view) | Author: Guido van Rossum (gvanrossum) * (Python committer) | Date: 2002年09月26日 19:16 | |
Logged In: YES user_id=6380 Yes, it's args[0] for KeyError, but Jim objected that this is a rather obscure protocol; he would prefer to have a designated attribute. |
|||
| msg61280 - (view) | Author: Georg Brandl (georg.brandl) * (Python committer) | Date: 2008年01月20日 12:28 | |
Will this be revisited for py3k? |
|||
| msg61475 - (view) | Author: Guido van Rossum (gvanrossum) * (Python committer) | Date: 2008年01月22日 01:53 | |
I think it would be a good idea to revisit this for py3k, but I'm out of round tuits. Anyone else want to tackle this? It should ideally be done in such a way that non-core object types can also easily raise these exceptions with the appropriate attributes, both from C and from Python. |
|||
| msg107340 - (view) | Author: Alexander Belopolsky (belopolsky) * (Python committer) | Date: 2010年06月08日 20:16 | |
It looks like issue2651 is the first step for this. See msg66432. I am merging the nosy lists. |
|||
| msg222419 - (view) | Author: Mark Lawrence (BreamoreBoy) * | Date: 2014年07月06日 21:37 | |
See also #18156, #18163, #18165 and #18166, possibly others? |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月10日 16:05:42 | admin | set | github: 37218 |
| 2020年10月23日 18:11:42 | iritkatriel | set | versions: - Python 3.8, Python 3.9 |
| 2020年10月22日 22:55:24 | iritkatriel | set | versions: + Python 3.8, Python 3.9, Python 3.10, - Python 3.2 |
| 2019年04月26日 18:32:44 | BreamoreBoy | set | nosy:
- BreamoreBoy |
| 2014年07月06日 21:37:03 | BreamoreBoy | set | nosy:
+ BreamoreBoy messages: + msg222419 |
| 2010年08月05日 16:21:10 | belopolsky | set | assignee: belopolsky -> |
| 2010年06月08日 20:16:51 | belopolsky | set | assignee: belopolsky dependencies: + Strings passed to KeyError do not round trip type: enhancement versions: + Python 3.2, - Python 3.0 nosy: + amaury.forgeotdarc, belopolsky, pitrou, rharris messages: + msg107340 stage: needs patch |
| 2009年01月06日 05:06:53 | gvanrossum | set | assignee: gvanrossum -> (no value) nosy: - gvanrossum |
| 2008年01月22日 01:53:46 | gvanrossum | set | messages: + msg61475 |
| 2008年01月20日 12:28:07 | georg.brandl | set | nosy:
+ georg.brandl messages: + msg61280 versions: + Python 3.0 |
| 2002年09月25日 18:17:08 | gvanrossum | create | |