Re:Mercurial’s journey to and reflections on Python 3
by lacker on Monday January 13, 2020 @02:40PM
(#22037800)
It seems like a lot of the cost was when system libraries made different choices than Mercurial would have made. For example, the Python 3 filesystem libraries often used unicode as a wrapper around an underlying bytes interface, and Mercurial really wanted to be able to pass bytes directly to the underlying interface. So it isn't just that they had to update their data types, they also had to adjust code to work with system libraries of slightly different semantics.
[ Parent
| on HN ]
Re:Mercurial’s journey to and reflections on Python 3
by wnoise on Monday January 13, 2020 @04:00PM
(#22038525)
The python interface usually would take bytes, and if it did would also return bytes. But there were a lot of things that didn't take arguments, so always returned Unicode strings. Instead of e.g. getcwd(), you would have to use getcwdb(). Which naturally didn't have an equivalent in python 2 though they did add the complementary getcwdu() (which one should basically never use).