What kind of signature for this special method?

Thiago Macieira thiago at kde.org
Fri Oct 13 07:03:22 PDT 2006


Luigi Paioro wrote:
>Sorry, you're right! With Python, when you define a function or a class
>method like this:
>
>def example(**args):
>   # do something
>
>you can pass to the example() function many key/value pairs which are
>kept as a dictionary. That means that this:
>
>example(a=5, b=10, c="my string")
>
>is passed to the function as a single dictionary args:
>
>args => {a:5, b:10, c:"my string"}
>
>even if you pass it as different single arguments. I don't know the
>details on how this mechanism works.

Then use an "a{sv}", which is a dictionary of strings to variants.

-- 
  Thiago Macieira  -  thiago (AT) macieira.info - thiago (AT) kde.org
    PGP/GPG: 0x6EF45358; fingerprint:
    E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/dbus/attachments/20061013/8b61c319/attachment.pgp


More information about the dbus mailing list