Demian Brecht added the comment: + loewis as he's listed as the xmlrpc expert
If you're worried about the number of lines, turn the function into a lambda: proxy = ServerProxy('http://example.com/gateway/', transport=Transport( connection_factory=lambda h: HTTPConnection(h, timeout=42))) I think that the problem with the way that you're looking at the problem:'just only for adding "timeout"', when what you're fundamentally after is to modify the attribute of an object two levels removed by composition. I /do/ agree that this is slightly more complex than simply setting a timeout parameter, but I also think that it's actually quite a bit more flexible and practically useful. Borrowing from PEP20: "There should be one-- and preferably only one --obvious way to do it.". Having a timeout at the top level ServerProxy object introduces ambiguity and therefore doesn't conform. Should the connection_factory concept be used, having a timeout parameter at the Transport level also introduces ambiguity. Setting the timeout through a custom HTTPConnection instantiated through connection_factory is an obvious way to do it (especially if documented) and is marginally more code. If you /only/ care about the timeout and really don't want to be bothered with the connection_factory, you can always set the global socket timeout for the given request with: socket.setdefaulttimeout([timeout]) ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue14134> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com