I think the biggest API "problem" is that default iteration returns integers instead of bytes. That's a real pain.
I'm not sure .iterbytes() is the best name for spelling iteration over bytes instead of integers though. Given that we can't change __iter__(), I personally would perhaps prefer a simple .bytes property over which if you iterated you would receive bytes, e.g. >>> data = bytes([1, 2, 3]) >>> for i in data: ... print(i) ... 1 2 3 >>> for b in data.bytes: ... print(b) ... b'\x01' b'\x02' b'\x03' There are no backward compatibility issues with this of course. As for the single-int-ctor forms, they're inconvenient and arguably "wrong", but I think we can live with it. OTOH, I don't see any harm by adding the .zeros() alternative constructor. I'd probably want to spell the .byte() alternative constructor .from_int() but I also don't think the status quo (or .byte()) is that much of a usability problem. The API churn problem comes about when you start wanting to deprecate the single-int-ctor form. *If* that part gets adopted, it should have a really long deprecation cycle, IMO. Cheers, -Barry _______________________________________________ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com