unstale

pypi / mypy-protobuf

mypy-protobuf

What changed in mypy-protobuf 4 to 5, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-21.

4 breaking2 deprecations9 new APIs and options7 fixes and other

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

npx @unstale/cli init

@unstale/cli 0.2.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 412 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 9

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

    4.0.0release notes

  • This type alias supports typing field manipulation functions.

    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