my own type in C, sequence protocol

Grant Edwards grante at visi.com
Thu Sep 9 17:54:59 EDT 2004


On 2004-09-09, Torsten Mohr <tmohr at s.netic.de> wrote:

> thanks for that explanation.  From the error messages i got i
> already thought of something like this.  But still i'm
> confused, what is the advantage to implement the sequence
> protocol for my type then?
>
> The type that i implemented is a "CAN message", don't know if
> this means something to you, it is a communication message
> with 0 to 8 bytes content.  To access this content i thought
> there would be an advantage in implementing the sequence
> protocol.  What is the advantage then?

Good question.  

[I just use lists of integers for my CAN messages.]

If you want to iterate over your object, you probably want to
support the sequence protocol.

-- 
Grant Edwards                   grante             Yow!  Is this where people
                                  at               are HOT and NICE and they
                               visi.com            give you TOAST for FREE??



More information about the Python-list mailing list