[issue18163] Add a 'key' attribute to KeyError

Raymond Hettinger report at bugs.python.org
Wed Jun 12 02:46:23 CEST 2013


Raymond Hettinger added the comment:

Since the key is already accessible via the "args" attribute, what is the point of a new attribute?

>>> d = {}
>>> try:
	d['roger']
except KeyError as e:
	print(e.args)

	
('roger',)

----------
nosy: +rhettinger

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue18163>
_______________________________________


More information about the Python-bugs-list mailing list