KEMBAR78
Upstream `V = int` to protoc's EnumTypeWrapper runtime · Issue #169 · nipunn1313/mypy-protobuf · GitHub
Skip to content

Upstream V = int to protoc's EnumTypeWrapper runtime #169

@nipunn1313

Description

@nipunn1313

Currently, the NewType('MyEnumValue', int) only exists within mypy stubs, but not in the original python code generated by protoc.

This results in ugly callsites like

from proto.mylib import MyEnum

MYPY = False
if MYPY:
    from proto.mylib. import MyEnumValue

If we can upstream to protoc a simple line

MyEnumValue = int

Then, the callsites can use mypy-protobuf more smoothly by doing

from proto.mylib import MyEnum, MyEnumValue

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