python-betterproto icon indicating copy to clipboard operation
python-betterproto copied to clipboard

Suggestion: use abstract base class and abstractmethod for ServiceBase and/or Stub

Open honglei opened this issue 3 years ago • 1 comments

python-betterprot is awesome. However, users may forget to implement some service-methods declared in proto file, which cause no error on the server-side. @abstractmethod may give user some hints to realize it. One question: why user should implement method echo_stream in EchoService while the related rpc method named EchoStream in proto file?

honglei avatar Apr 22 '22 14:04 honglei

This seems like a decent idea.

One question: why user should implement method echo_stream in EchoService while the related rpc method named EchoStream in proto file?

Because this project inforces python naming conventions, using PascalCase for a method is a "c++-ism"

Gobot1234 avatar Apr 22 '22 14:04 Gobot1234