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.

Author mark.dickinson
Recipients barry, brett.cannon, mark.dickinson, r.david.murray, rhettinger
Date 2013-06-13.15:47:53
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1371138473.77.0.567799776638.issue18163@psf.upfronthosting.co.za>
In-reply-to
Content
+1.  I recently chastised a colleague for doing "raise KeyError(long_message)" instead of "raise KeyError(missing_item)".  When I went to the standard library to support my POV, I found (to my chagrin) a big mix of the two styles.


>>> from collections import ChainMap
>>> d = ChainMap({}, {})
>>> try:
...     d.pop('not there')
... except KeyError as e:
...     key, = e.args
... 
>>> key
"Key not found in the first mapping: 'not there'"
History
Date User Action Args
2013-06-13 15:47:53mark.dickinsonsetrecipients: + mark.dickinson, barry, brett.cannon, rhettinger, r.david.murray
2013-06-13 15:47:53mark.dickinsonsetmessageid: <1371138473.77.0.567799776638.issue18163@psf.upfronthosting.co.za>
2013-06-13 15:47:53mark.dickinsonlinkissue18163 messages
2013-06-13 15:47:53mark.dickinsoncreate