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.

Author Fergal.Daly
Recipients Fergal.Daly, docs@python
Date 2010-11-08.13:16:23
SpamBayes Score 6.8807785e-06
Marked as misclassified No
Message-id <1289222187.72.0.886873143688.issue10357@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2010-11-08 13:16:28Fergal.Dalysetrecipients: + Fergal.Daly, docs@python
2010-11-08 13:16:27Fergal.Dalysetmessageid: <1289222187.72.0.886873143688.issue10357@psf.upfronthosting.co.za>
2010-11-08 13:16:24Fergal.Dalylinkissue10357 messages
2010-11-08 13:16:23Fergal.Dalycreate