[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Bindings for dump stream parser

From: C. Michael Pilato <cmpilato_at_collab.net>
Date: Mon, 01 Dec 2014 12:27:41 -0500

On 12/01/2014 12:04 PM, Alexey Neyman wrote:
>
> On 12/01/2014 06:17 AM, C. Michael Pilato wrote:
>> Just a quick question, as my bindings knowledge has grown somewhat
>> stale: why do some of the wrapper functions use a format string with
>> the tuple notation (e.g., "(O)") and others not (e.g., "Oss#O&")?
>>
>> I notice that the basic editor wrapping methods have the same
>> disparity. I'm probably overlooking something obvious, but hey, it's
>> Monday, so be gentle.
> It is rather the opposite: the "Oss#O&" implicitly requests a tuple
> packing by virtue of having more than one value to pack.
>
> PyObject_CallMethod (and other similar functions) defer to the
> Py_BuildValue for the description of the format string. The latter
> states that by default, it only builds a tuple if there are two or
> more arguments to be packed; for one argument, it returns just the
> object specified by the format string and for zero arguments, it
> returns None.
>
> I am not sure what it would mean to pass a non-tuple to a callable
> Python object as an argument though; haven't tried it myself.
>

Ah, thanks for the clarification.

FWIW, I took a cruise through your patch, and it all seems consistent
with the rest of our Python wrapping logic. I agree with Bert's
recommendation to commit away and tweak post-facto as needed.

-- 
C. Michael Pilato <cmpilato_at_collab.net>
CollabNet   <>   www.collab.net   <>   Enterprise Cloud Development
Received on 2014-12-01 18:29:02 CET

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.