3 ms·
Not really, no. There are some automatic transforms that "2to3" will do for you, and it's mostly automated, but the string handling is fundamentally different i
by pjc50 7y ago
Not really, no. There are some automatic transforms that "2to3" will do for you, and it's mostly automated, but the string handling is fundamentally different in subtle ways and there are a few places where you have to alter your entire architecture (e.g. make all your exceptions inherit from Exception). If your architecture makes too many assumptions about the equivalence of characters and bytes problems can be severe.
The decision to make it not backward-compatible and thereby force-deprecate millions of lines of working Python code was extremely expensive.
- BJBBB 7y agoTend to agree. My previous employer did most of the ATE, quality, and production control in Python; and hardware drivers mostly in C. It worked reliably for about 15 years. During late 2017, the new 'code boss' mandated Python 3 for new stuff, and to convert as required for existing stuff. Production continued with little or no problems until an important customer did a major spec change, plus the new safety and EMC regulations and standards became effective, so we had to get some stuff re-certified and some processes accredited (again). After three months, the boss fired the three programmers and assigned the task to the quality, manufacturing and regulatory engineers. We looked at the code for a few days, then said nope and re-designed and wrote in C/C++. When I left in November, things were humming along well, but the parent company saw this as a huge future liability and commenced to shut down that part of the company that made that class of widgets. Think about - a group of less than 40 production people and a few engineers that pumped 25 million USD profit annually into the mother company was dropped because of potential future code shenanigans. Because of these experiences, I discourage use Python professionally (unless the contract allows for some specific indemnity clauses) for quality and manufacturing, and know of other manufacturing and hardware activities abandoning Python for new stuff and 'returning' to C and C++. I continue to enjoy and use Python (mostly 3) for personal projects, where support and making money do not always matter.