Is there a nice solution to do something like this lambda function in a parameter list?
timeout = None
[...]
response = self.session.post(
url=self.baseUrl,
data=str(data),
headers=headers,
timeout=lambda: 0 if self.timeout is None else self.timeout
)
I know it throws an exception. But is there a possible solution to do something like this?
Thanks
postmethod is not expecting a callable, so I don't understand why you are passing it one. Why can't you simply dotimeout=0 if self.timeout is None else self.timeout?