JPMorgan still has its Python 2 issues
efinancialcareers.com
efinancialcareers.com
Clearly the 2->3 transition is costly for JPMorgan and some others.
Let's suppose they were willing to fund a special edition version of Python, to help with the upgrade process. Let's say, 10 FTEs for three years.
What might it have looked like?
For example, could Python 2.7's string object be annotated to remember if the string was a b"" string or a "" string, with that information tracked appropriately, to report if byte string is used in a Unicode context?
Ditto for open() on binary vs. text files.
And could the history of the creation and later changes be tracked, to help identify where the problem was?
Now, if done at the C level this would cause changes in the PyObject layout, which would probably break extensions. But then what about AST transformations to put all that tracking information at the byte code level?
That's just one idea - what else could have been done with $8 million in funding that would have made it worthwhile for enough companies to fund?
Then I look at Python itself, and how large companies pay so little for its core development, and I realize that the above is just a pipe dream.
with open("a", "rb") as f:
with open("b", "w") as g:
g.write(">" + f.read(1))
There are also conversions in Python 2 between byte and string which aren't supported in Python 3: s = "123".encode("hex")
t = "abcd".decode("hex")