Can i use a python keywords as parameter names?

Asked by armonge on 2012-05-18

I'm using Ladon to implement a SOAP service based on an existing wsdl. One of the methods exposed by this service looks like

<message name="listaNegraRequest">
  <part name="movil" type="xsd:string" />
  <part name="accion" type="xsd:string" />
  <part name="pass" type="xsd:string" />

Which i believe would be represented by a callable like:

@ladonize(PORTABLE_STRING, int, PORTABLE_STRING, rtype=list)
    def listaNegra(self, movil, accion, pass_, **kwargs):

However i can't user "pass" as a parameter because it's a python keyword. Is there any support for something like this?. If there isn't, where should i hack to add support for this?

In rpclib there is _type_info


Question information

English Edit question
ladon Edit question
No assignee Edit question
Solved by:
Last query:
Last reply:
jsgaarde (jakob-simon-gaarde) said : #1

I'm afraid not, but it wouldn't be that hard to add though, cause Ladon has a dictionary type-definition feature where such a name-mangling thingy could be implemented.
I will put it on the todo-list.

So I guess for now you will have to choose between performance or getting the parameter names right ;-)

Best Regards
Jakob Simon-Gaarde

armonge (armonge) said : #2

Hi, thanks for your kind help

I made a little fork to add this and a simple patch in:

It doesn't have any unttests or anything but works for me. Also i used github because I don't really know how to bzr

Best Regards
Andrés Reyes Monge