[New-bugs-announce] [issue10221] {}.pop('a') raises non-standard KeyError exception

Dirkjan Ochtman report at bugs.python.org
Thu Oct 28 15:26:42 CEST 2010


New submission from Dirkjan Ochtman <dirkjan at ochtman.nl>:

djc at miles ~ $ python2.7
Python 2.7 (r27:82500, Oct  4 2010, 10:01:41)
[GCC 4.3.4] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> {}.pop('a')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
KeyError: 'pop(): dictionary is empty'
>>> {'a': 'b'}.pop('c')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
KeyError: 'c'

IMO the former exception should be in line with normal KeyErrors.

----------
messages: 119778
nosy: djc
priority: normal
severity: normal
status: open
title: {}.pop('a') raises non-standard KeyError exception

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


More information about the New-bugs-announce mailing list