This patch (attached, works with r81) adds slicing support for repeated
fields in Python.  It implements retrieval, setting, and deletion for both
scalar and composite repeated fields, and adds several unit tests for each
method.

There was already a remove() method for repeated scalars, but not for
composites.  I added one without any difficulty.  Did I miss something?  In
fact, this whole patch was pretty easy.  There must be some reason it hasn't
been done before.

The __eq__() method for repeated composites disallows comparing to any other
sequence type, including ordinary lists.  Why can't we do this?

Adding more methods to the _RepeatedScalarFieldContainer and
_RepeatedCompositeFieldContainer classes makes it even more painfully
obvious that they need to be merged.  I'm sure we can make it polymorphic,
and that'll probably be my next patch.

The docs aren't on the wiki, so I can't add anything about this.  Are there
plans to move it to the wiki, by any chance?

Thanks,
Alek Storm

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en
-~----------~----~----~----~------~----~------~--~---

Attachment: slice.patch
Description: Binary data

Reply via email to