[issue25016] defaultdict's pop gives a KeyError

2015-09-07 Thread Martin Panter

Martin Panter added the comment:

I think this is by design. Under 

 it says “__missing__() is _not_ called for any operations besides 
__getitem__().” What gave you the impression that pop() should return a default 
value?

--
nosy: +martin.panter

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25016] defaultdict's pop gives a KeyError

2015-09-07 Thread Chase Albert

New submission from Chase Albert:

`defaultdict(list).pop(1)` raises a KeyError, this is not what I expected (I 
expected an empty list).

--
components: Library (Lib)
messages: 250080
nosy: rob.anyone
priority: normal
severity: normal
status: open
title: defaultdict's pop gives a KeyError
type: behavior
versions: Python 2.7, Python 3.4

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com