Author ncoghlan
Recipients ezio.melotti, ncoghlan
Date 2019-07-20.12:45:54
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
At the core dev sprints in 2017 (IIRC), Ezio and I were talking about some of the potential issues with 3.10, and one of them was folks attempting to manipulate sys.version with string operations rather than using the already decomposed sys.version info.

Anthony Sottile has recently been experimenting with a Python build patched to report itself as 3.10 to see what breaks, and indicated that many of the failures were due to that kind of problem (in particular: writing "sys.version[:3]" instead of "'{}.{}'.format(sys.version_info[:2])")

One possible remedy that Ezio and I discussed was the idea of an "OpaqueString" type that presented as a string, but raised an error if you tried any operations that assumed it could be meaningfully decomposed character-by-character.

This would probably need to be a string subclass for compatibility, and would need a transitional variant that only emitted deprecation warnings rather than failing outright.
Date User Action Args
2019-07-20 12:45:55ncoghlansetrecipients: + ncoghlan, ezio.melotti
2019-07-20 12:45:55ncoghlansetmessageid: <>
2019-07-20 12:45:55ncoghlanlinkissue37636 messages
2019-07-20 12:45:54ncoghlancreate