danielgtaylor / python-betterproto

Clean, modern, Python 3.6+ code generator & library for Protobuf 3 and async gRPC
MIT License
1.56k stars 218 forks source link

ListValue is not iterable #636

Open powellnorma opened 1 month ago

powellnorma commented 1 month ago

Summary

ListValue is not iterable

What is the feature request for?

The core library

The Problem

With official protobuf_pb2, you can do:

args = ListValue()
args.extend([1,2,3])
some_function(*args)

But with betterproto this doesn't work currently https://github.com/danielgtaylor/python-betterproto/blob/335eee753734e89364135bdde829a069838ee297/src/betterproto/lib/std/google/protobuf/__init__.py#L2300

The Ideal Solution

Add some wrapper methods (extend, iter, ..)

The Current Solution

Always use .value