This PR removes the py_input_message function from ServiceMethodCompiler. This function was only used in two places, in the template file. The return value was not actually used, it was only checked whether it was None or not.
However, the function should never actually return None, since an rpc always takes an existing message as parameter. If the function returns None, as far as understand, it means that there is a problem somewhere in betterproto.
In any case, the check is not useful: if the condition that I deleted was not satisfied (which should not happen from what I understand), an invalid code would have been generated since the variable method.py_input_message_param would have been used later without having being declared.
I sometimes see things like that in the code, I imagine that it is better that I do small pull-requests each time, what do you think? Or is there any reason to keep the code for now, for example for future use?
Checklist
[X] If code changes were made then they have been tested.
Summary
This PR removes the
py_input_message
function fromServiceMethodCompiler
. This function was only used in two places, in the template file. The return value was not actually used, it was only checked whether it was None or not.However, the function should never actually return None, since an
rpc
always takes an existing message as parameter. If the function returns None, as far as understand, it means that there is a problem somewhere in betterproto.In any case, the check is not useful: if the condition that I deleted was not satisfied (which should not happen from what I understand), an invalid code would have been generated since the variable
method.py_input_message_param
would have been used later without having being declared.I sometimes see things like that in the code, I imagine that it is better that I do small pull-requests each time, what do you think? Or is there any reason to keep the code for now, for example for future use?
Checklist