Cult-like behaviour [was Re: Kindness]

Chris Angelico rosuav at gmail.com
Mon Jul 16 18:48:55 EDT 2018


On Tue, Jul 17, 2018 at 8:41 AM, Roel Schroeven <roel at roelschroeven.net> wrote:
> In any case, even though Python 3's byte strings are not quite unlike Python
> 2's strings, they're not exactly like them either. And I feel there are
> cases where that makes things somewhat harder, even though I can't prove it.

You're absolutely right, and some of those differences were repaired
in different 3.x versions (for instance, the ability to use
percent-formatting with byte strings was reinstated in 3.5). Some of
the differences are fundamental, but anything else should be
considered fair game for an enhancement request. So next time you go
"ugh, Python 3's byte strings are such a pain because XYZ", post here
or on python-ideas about a possible fix.

That said, though, the fact that indexing a byte string yields an int
instead of a one-byte string is basically unable to be changed now,
and IMO it'd be better to be consistent with text strings than with
bytearray. I'm not sure how many of the core devs agree that
b'spam'[1] ought to be b'p' rather than 112, but I'd say they all
agree that it's too late to change it.

ChrisA



More information about the Python-list mailing list