On 06/25/12 20:29, C Anthony Risinger wrote:
hello,

while briefly trying to update to the spyne codebase, i am encountering an AssertionError due to spyne enforcing a 1-to-1 mapping between MethodDescriptor and the function it wraps:

File "/path/to/spyne/interface/_base.py", line 224, in populate_interface
    assert not s.get_method_id(method) in self.method_id_map
AssertionError
<snip>

i haven't spent much time investigating, but why is this restriction necessary?

This was so that you don't accidentally overwrite functions. But it seems like my assumptions were wrong.

the solution ATM means needlessly wrapping _proxy for each method with a module level function, since lambdas probably wouldn't work either (albeit, i didn't try :-)

how can i solve this cleanly, or better, patch spyne to not care what callable actually implements the method (since the pattern was working rather nicely)?


I couldn't run your code, (I don't have the awesome package) but the responsible for this is the get_method_id in ServiceBase.

https://github.com/arskom/spyne/blob/master/spyne/service.py#L200

Does replacing the 'descriptor.function.__name__' with 'descriptor.name' solve your problem?

burak
_______________________________________________
Soap mailing list
[email protected]
http://mail.python.org/mailman/listinfo/soap

Reply via email to