nipunn1313 / mypy-protobuf

open source tools to generate mypy stubs from protobufs
Apache License 2.0
648 stars 80 forks source link

google-stubs/protobuf/well_known_types and others #135

Closed Evgenus closed 3 years ago

Evgenus commented 4 years ago

What do you think about creating package with stubs for google.protobuf internal classes?

In that case all generated messages annotations could just inherit base Message class (same way as actually generated protobuf messages do)

nipunn1313 commented 4 years ago

RepeatedCompositeFieldContainer should inherit from Sequence here in typeshed - which comes for free with mypy

https://github.com/python/typeshed/blob/master/third_party/2and3/google/protobuf/internal/containers.pyi#L38

Shouldn't need to be autogenerated - rather we should be able to get it out of typeshed. I believe that we don't actually copy methods of Message class - only ones that need more special annotations.

nipunn1313 commented 3 years ago

WKT are supported now!