New submission from Fergal Daly <ferg...@gmail.com>:

According to the index, the only place that mentions ** in argument lists is

http://docs.python.org/tutorial/controlflow.html#index-1099

and gives no indication of what an object must support to allow **.

When you attempt to ** an object the real attribute exception is suppressed and 
you get a message

"argument after ** must be a mapping"

"mapping" is quite loosely defined. There are 3 definitions, the glossary entry 
seems the most complete

http://docs.python.org/library/stdtypes.html#index-625
http://docs.python.org/reference/datamodel.html#index-842
http://docs.python.org/glossary.html#term-mapping

But even the glossary entry doesn't tell you what you need for **.

Only by reading the C source code did I discover that to be usable in **, an 
object must implement .keys() and .__getitem__().

The docs either should add .keys() to the definition of mapping or the code 
should use some other term or simply allow the original exception to reach the 
user.

----------
assignee: d...@python
components: Documentation
messages: 120739
nosy: Fergal.Daly, d...@python
priority: normal
severity: normal
status: open
title: ** and "mapping" are poorly defined in python docs
versions: Python 2.7

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue10357>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to