[Python-checkins] r80450 - in python/branches/py3k: Doc/c-api/arg.rst Include/dictobject.h Include/modsupport.h Lib/test/test_dict.py Misc/NEWS Objects/dictobject.c Python/getargs.c

Georg Brandl g.brandl at gmx.net
Sun Apr 25 22:25:26 CEST 2010


Am 24.04.2010 20:21, schrieb benjamin.peterson:
> Author: benjamin.peterson
> Date: Sat Apr 24 20:21:17 2010
> New Revision: 80450
> 
> Log:
> prevent the dict constructor from accepting non-string keyword args #8419
> 
> This adds PyArg_ValidateKeywordArguments, which checks that keyword arguments
> are all strings, using an optimized method if possible.

> Modified: python/branches/py3k/Doc/c-api/arg.rst
> ==============================================================================
> --- python/branches/py3k/Doc/c-api/arg.rst	(original)
> +++ python/branches/py3k/Doc/c-api/arg.rst	Sat Apr 24 20:21:17 2010
> @@ -366,6 +366,13 @@
>     va_list rather than a variable number of arguments.
>  
>  
> +.. cfunction:: int PyArg_ValidateKeywordArguments(PyObject *)
> +
> +   Ensure that the keys in the keywords argument dictionary are strings.  This
> +   is only needed if :cfunc:`PyArg_ParseTupleAndKeywords` is not used, since the
> +   latter already does this check.

*cough* versionadded?

Georg


-- 
Thus spake the Lord: Thou shalt indent with four spaces. No more, no less.
Four shall be the number of spaces thou shalt indent, and the number of thy
indenting shall be four. Eight shalt thou not indent, nor either indent thou
two, excepting that thou then proceed to four. Tabs are right out.



More information about the Python-checkins mailing list