Skip to content

Replace mypy-protobuf with protobuf pyi_out #14753

@matejsp

Description

@matejsp

I noticed that pyi_out is a lot cleaner and more readable that mypy-protobuf. Since pyi generation is part of protobuf it is probably prefered instead of unofficial mypy_protobuf.

And there is also one interesting sideeffect that enums constants are not compatible between themselves exposing couple of bugs in our code.

For example:

enum EnumA {
  A_A = 0;
  A_B = 1;
}

enum EnumB {
  B_A = 0;
  B_B = 1;
}

message Msg {
  EnumA name = 1;
}

mypy is not bothered that name can also be used with B_A and B_B. But it works with pyi_out generated code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions