You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The files that are emitted from protoc's Python plug in are fairly incomprehensible to mypy, PyCharm, and pretty much any other tool that tries to get typing information. This is the main blocker to enabling mypy over the entire codebase and being able to address issues like #189 as part of the build.
.pyi files have been manually introduced as part of #192, but maintaining them going forward will be quite error prone. Still, the exercise was instructive because it at least highlights the requirements of such a tool:
Handle references to other Protobuf files properly via imports, particularly taking into account that the we slightly modify the default Python packaging behavior of protoc.
Handle gRPC AsyncIO service stubs, somewhat complicated by the fact that the stubs themselves change their behavior based on the passed-in channel.
Literal types for key functions (WhichOneof) where restricting the allowable strings makes sense.
Constructors that understand the semantics around oneof and produce the appropriate overloads.
Properly-typed repeated types, particularly support for [T].add() -> T, which is a Protobuf-specific function.
The text was updated successfully, but these errors were encountered:
The files that are emitted from
protoc
's Python plug in are fairly incomprehensible tomypy
, PyCharm, and pretty much any other tool that tries to get typing information. This is the main blocker to enablingmypy
over the entire codebase and being able to address issues like #189 as part of the build..pyi
files have been manually introduced as part of #192, but maintaining them going forward will be quite error prone. Still, the exercise was instructive because it at least highlights the requirements of such a tool:protoc
.WhichOneof
) where restricting the allowable strings makes sense.oneof
and produce the appropriate overloads.repeated
types, particularly support for[T].add() -> T
, which is a Protobuf-specific function.The text was updated successfully, but these errors were encountered: