[Python-Dev] PEP 467: Minor API improvements to bytes, bytearray, and memoryview (original) (raw)
Koos Zevenhoven k7hoven at gmail.com
Tue Jun 7 18:22:21 EDT 2016
- Previous message (by thread): [Python-Dev] PEP 467: Minor API improvements to bytes, bytearray, and memoryview
- Next message (by thread): [Python-Dev] PEP 467: Minor API improvements to bytes, bytearray, and memoryview
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Wed, Jun 8, 2016 at 12:57 AM, Barry Warsaw <barry at python.org> wrote:
On Jun 07, 2016, at 09:40 PM, Brett Cannon wrote:
On Tue, 7 Jun 2016 at 14:38 Paul Sokolovsky <pmiscml at gmail.com> wrote: What's wrong with b[i:i+1] ? It always succeeds while indexing can trigger an IndexError. Right. You want a method with the semantics of getitem() but that returns the desired type.
And if this is called getitem (with slices delegated to bytes.getitem) and implemented in a class, one has a view. Maybe I'm missing something, but I fail to understand what makes this significantly more problematic than an iterator. Ok, I guess we might also need len.
-- Koos
-Barry
Python-Dev mailing list Python-Dev at python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/k7hoven%40gmail.com
- Previous message (by thread): [Python-Dev] PEP 467: Minor API improvements to bytes, bytearray, and memoryview
- Next message (by thread): [Python-Dev] PEP 467: Minor API improvements to bytes, bytearray, and memoryview
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]