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.

classification
Title: dict.popitem documentation should mention empty dict case
Type: Stage:
Components: Documentation Versions: Python 2.4
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: misterwilliam, rhettinger
Priority: normal Keywords:

Created on 2005-05-27 07:49 by misterwilliam, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (3)
msg25424 - (view) Author: William Chang (misterwilliam) Date: 2005-05-27 07:49
Currently the documentation in the Python Library
Reference entry for Mapping Types does not mention what
happens when dict.popitem() is called on an empty mapping. 

I think that the documentation should mention that a
KeyError exception is raised. (At least this is what
happens when I try it in the official Python 2.4
release with a dictionary.)

If this omission was intentional to give room for
future implementors of python/mappings I feel that this
should at least be mentioned in the documentation to
remind programmers this behavior is not specified.
msg25425 - (view) Author: William Chang (misterwilliam) Date: 2005-05-27 07:51
Logged In: YES 
user_id=1286263

I wasn't being very precise when I substituted dict for
mapping types in the summary. I'm so used to thinking of
them interchangeablely. I suppose it might matter though.
msg25426 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2005-05-27 10:46
Logged In: YES 
user_id=80475

Okay, fixed.
Thanks for the report.
History
Date User Action Args
2022-04-11 14:56:11adminsetgithub: 42022
2005-05-27 07:49:04misterwilliamcreate