News Announcements for Version 21.x

Changes announced for Protocol Buffers version 21.x.

The following announcements are specific to Version 21.x. For information presented chronologically, see News.

Python Updates

We made some changes in Python language support in Protocol Buffers. Version 4.21.0 is a new major version, following 3.20.1. The new version is based on the upb library, and offers significantly better parsing performance than previous releases, especially for large payloads. It also includes prebuilt binary modules for Apple silicon for increased performance without a manual build.

The new release does contain some breaking changes. Specifically:

  • The UnknownFields() method, which relied on an implicitly created class, is replaced with the explicitly-created UnknownFieldSet class.
  • Some non-core characteristics may have changed, such as the specific format of certain strings or error messages. These are not considered breaking changes, but may still impact your existing code base.
  • Applications that rely on sharing messages between Python and C++ break in the new version. Most developers won’t be affected by this, but users of Nucleus and possibly other libraries may be. As a workaround, you can set an environment variable that forces the library to preserve compatibility.
  • Python upb requires generated code that has been generated from protoc 3.19.0 or newer.