On Thu, 17 Jul 2014 07:18:54 +0200, Frank Millman wrote: > "Steven D'Aprano" <steve+comp.lang.pyt...@pearwood.info> wrote in > message news:53c66ba8$0$9505$c3e8da3$54964...@news.astraweb.com... >> >> E.g. having b"abc"[0] return 97 instead of b"a" was probably a mistake, >> but there are four versions of Python 3.x that do it that way and it's >> too late to change until Python 5000. (Python 4 is unlikely to break >> backwards compatibility in a big way.) >> >> > If it was considered important enough, couldn't they just introduce a > new datatype, say B'...', with the desired behaviour. B'' would be > backported to Python 2.7 as an alternative to b'', to faciliate writing > code that works on both versions.
Sure, if it were considered important enough. But such an addition would add complexity and redundancy to the language, and would add one more thing that people have to learn and decide about. People would confuse which one was which, which would lead to bugs. Since b'abcd'[0:1] takes only a tiny bit more effort than b'abcd'[0], fixing this is not considered worth the cost. -- Steven -- https://mail.python.org/mailman/listinfo/python-list