Python generates TitleCase service methods and not snake_case

44 views
Skip to first unread message

Jimmy Zelinskie

unread,
Jul 13, 2021, 1:27:12 PM7/13/21
to grpc.io
Apologies if I'm missing something obvious, but I searched GitHub and this mailing list first.

protoc-gen-python generates code that follows the typical Python style: TitleCase for classes and snake_case for methods.
protoc-gen-grpc-python generates stubs that use TitleCase for both classes and methods.

An example Stub:

class MyServiceStub(object):
    def __init__(self, channel):
        self.ReadSchema = channel.unary_unary(
                '/MyService/ReadSchema',
                request_serializer=my__pb2.ReadSchemaRequest.SerializeToString,
                response_deserializer=my__pb2.ReadSchemaResponse.FromString,
                )
        self.WriteSchema = channel.unary_unary(
                '/MyService/WriteSchema',
                request_serializer=my__pb2.WriteSchemaRequest.SerializeToString,
                response_deserializer=my__pb2.WriteSchemaResponse.FromString,
                )

Shouldn't these methods be self.read_schema and self.write_schema?
Reply all
Reply to author
Forward
0 new messages