unstale

pypi / mypy-protobuf

mypy-protobuf

What changed in mypy-protobuf 3 to 5, from its official release notes, upgrade guides and advisories. Sources checked 2026-12-05.

5 breaking3 deprecations11 new APIs and options1 tooling7 fixes and other

See which of these apply to your code, ranked, in your agent:

npx @unstale/cli init

@unstale/cli 0.3.1 on npm

mypy-protobuf 510 changes

Breaking changes 2

  • Exports deprecated enum fields as class-level properties instead of module-level properties and marks them as deprecated.

    5.0.0release notes

  • Refactors import statements to follow a protoc pyi generator-like model, using aliases to prevent field-name collisions and fixing duplicate package name imports.

    5.0.0release notes

Deprecations 2

  • Exports deprecated fields as properties with getters and setters and marks them as deprecated.

    5.0.0release notes

  • Exports deprecated stub methods as properties instead of attributes and marks them as deprecated.

    5.0.0release notes

Fixes and other changes 6

  • Typing is overridden for ClearField on fields without presence and non-oneofs.

    5.1.0release notes

  • When a file is deprecated, all its messages, enums, services, and fields are deprecated too.

    5.1.0release notes

  • Typing is overridden for HasField on fields without presence and non-oneofs.

    5.1.0release notes

  • Typing is overridden for WhichOneof on fields without presence and non-oneofs.

    5.1.0release notes

  • Uses builtins.property to handle conflicts with fields named property.

    5.0.0release notes

  • Mangles all non-provided message type imports to prevent conflicts with field names; message imports remain unmangled to avoid a breaking change.

    5.0.0release notes

mypy-protobuf 411 changes

Breaking changes 2

  • Testing support for protobuf versions below 6.32 is dropped because they do not support editions; those versions may still work but are untested.

    4.0.0release notes

  • Support for py_generic_services is dropped because the protobuf compiler removed it starting in version 6.30.

    4.0.0release notes

New APIs and options 8

  • This option generates only the async version of gRPC stubs.

    4.0.0release notes

  • Support is added for protobuf editions up to 2024.

    4.0.0release notes

  • File-level field presence feature settings are supported.

    4.0.0release notes

  • This option generates concrete instead of abstract servicer stubs.

    4.0.0release notes

  • This type alias supports typing field manipulation functions.

    4.0.0release notes

  • This option generates only the sync version of gRPC stubs.

    4.0.0release notes

  • This type alias types the argument to WhichOneof for a given oneof.

    4.0.0release notes

  • This type alias types the return value of WhichOneof for a given oneof.

    4.0.0release notes

Fixes and other changes 1

  • Async stubs use __new__ overloads instead of TypeVar-based __init__ overloads.

    4.0.0release notes

mypy-protobuf 36 changes

Breaking changes 1

  • The top-level mangling prefix changes from global___ to Global___ to respect the Y042 naming convention.

    3.7.0release notes

Deprecations 1

  • PEP 702 deprecation is supported for enum messages; enum fields are not supported.

    3.7.0release notes

New APIs and options 3

  • Client stubs support async typing overloads.

    3.7.0release notes

  • PEP 702 message deprecations are supported.

    3.7.0release notes

  • PEP 702 service deprecations are supported for Sync stubs, but not async stubs.

    3.7.0release notes

Tooling 1

  • Top-level mangled identifiers are marked as TypeAlias.

    3.7.0release notes