[python-committers] Adding a (small) feature to 3.4 for Argument Clinic: inspect.Signature supporting simple named constants for default values

M.-A. Lemburg mal at egenix.com
Mon Jan 6 23:10:54 CET 2014


On 06.01.2014 22:34, Larry Hastings wrote:
> 
> p.s.
> 
> For what it's worth, the documentation for match() dodges this problem by outright lying.  It claims
> that the prototype for the function is:
> 
>     match(string[, pos[, endpos]])
> 
> which is a lie.  pattern_match() parses its arguments by calling PyArg_ParseTupleAndKeywords() with
> a format string of "O|nn".  Which means, for example, you could call:
> 
>     match("abc", endpos=5)
> 
> The documentation suggests this is invalid but it works fine.  So my feeling is, this is a
> legitimate problem, and those who came before me swept it under the rug.

Looks like a documentation bug to me. Several functions were changed
to be keyword aware some years ago and the docs you quoted still list
the old positional format.

-- 
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Source  (#1, Jan 06 2014)
>>> Python Projects, Consulting and Support ...   http://www.egenix.com/
>>> mxODBC.Zope/Plone.Database.Adapter ...       http://zope.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/
________________________________________________________________________

::::: Try our mxODBC.Connect Python Database Interface for free ! ::::::

   eGenix.com Software, Skills and Services GmbH  Pastor-Loeh-Str.48
    D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg
           Registered at Amtsgericht Duesseldorf: HRB 46611
               http://www.egenix.com/company/contact/


More information about the python-committers mailing list