News for hackers. Stuff that matters.
Re:Speed improvements in Python 3.7 by viraptor on Tuesday February 13, 2018 @08:33PM (#16372659)
Currently in python you know that you're holding either raw bytes, or something that can be successfully serialised to utf8. With your proposed solution you'll find out which one it is when you try to encode it.

It's the difference between easier to debug: "you asked me to read a value here, but your assumptions about the encoding don't match reality" exception and the hard to debug: "I did a lot of processing; you thought this thing is a valid text, but it isn't; have fun tracking down how it got here in the first place" exception.

Re:Speed improvements in Python 3.7 by mjevans on Tuesday February 13, 2018 @09:13PM (#16372875)
Python 3: We have two things that are ALMOST the same, and which if we'd done it correctly, could have been converted just by changing what we're willing to call it (in the "downgrade" direction; or also verifying if you want to achieve what I hate that Python 3 is forcing on programmers).

Proposed "string like" Object: __IF__ you want to turn on debugging, sure, force it to validate assumptions at runtime/compile time. Otherwise call verify() when you're willing to handle that being some result indicating "we have a problem".

Maybe the verify() call returns the byte-access-offset of the first non-conforming sequence.

Re:Speed improvements in Python 3.7 by viraptor on Tuesday February 13, 2018 @09:35PM (#16372960)
> We have two things that are ALMOST the same,

I think we've got a fundamental disagreement here. I don't believe they're similar at all. They just happened to get confused a lot in the past when it didn't matter that much.