dep-protobuf/python/google
Peter Hawkins 64f5694cb2 [numpy] Fix breakage in users of Python protobufs under NumPy 2.3rc1.
As of NumPy 2.3.0rc1, numpy.bool scalars can no longer be interpreted as index values (https://github.com/numpy/numpy/releases/tag/v2.3.0rc1). This causes protobuf no longer to accept a np.bool scalar as a legal value for a boolean field.

We have two options:
a) either we can change protobuf so that it continues to accept NumPy boolean scalars (this change), or
b) decide that protobuf should reject NumPy boolean scalars and that users must update their code to cast to a Python bool explicitly.

I have no strong opinion as to which, but option (a) seems less disruptive.

No test updates are needed: the existing tests fail under NumPy 2.3.

PiperOrigin-RevId: 766629310
2025-06-03 06:10:18 -07:00
..
protobuf [numpy] Fix breakage in users of Python protobufs under NumPy 2.3rc1. 2025-06-03 06:10:18 -07:00
__init__.py Set execute bit on files if and only if they begin with (#!). (#7347) 2020-04-01 15:28:25 -07:00