× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Thanks for the offer. Similar changes have occurred in PHP but the transition was more gradual with a lot of backward compatibility - or so it seems to me. In 5+ years I think I have only encountered about 5 things that required real thought to refactor.

Here’s one example of a 2to3 issue. Original lines are prefixed - converted are + (I know you know that but others will be reading!)

- except IOError, (strerror, errno):
- print 'Error: Could not open file to read --->', self._ifile
+ except IOError as xxx_todo_changeme:
+ (strerror, errno) = xxx_todo_changeme.args
+ print('Error: Could not open file to read --->', self._ifile)
sys.exit(3)

It is the “xxx_todo_changeme” bits that confuse. Am I supposed to just give it a name of my choosing ? or ?



Jon Paris

www.partner400.com
www.SystemiDeveloper.com

On Jul 14, 2015, at 9:51 PM, John Yeung <gallium.arsenide@xxxxxxxxx> wrote:

On Tue, Jul 14, 2015 at 7:26 PM, Jon Paris <jon.paris@xxxxxxxxxxxxxx> wrote:
I’m trying really hard to get my head around Python but I’m not impressed by the way the community appears to have handled the V2 to V3 transition.

The transition can be tough for newcomers. The landscape definitely
was simpler when there was just Python 2. But I think it seems worse
than it is because we're still in the middle of it. I believe if you
look at other transitions of similar scope throughout history and even
today, you'll find that Python's is going reasonably well. Not as well
as hoped, but also not as bad as some had feared.

Even when reading V3 docs I have found examples in the user contribution areas that don’t work because they were written for V2!

I'm sorry, what "user contribution areas"? If there is a Python-2-only
code snippet in the official Python 3 docs, that's a doc bug, and a
bug report is in order. I'm happy to report such bugs myself if you
point them out to me.

SO I run the 2to3 utility and 50% of the errors found require manual intervention. It is really slowing my learning down.

Yeah, that utility certainly wasn't designed for learners. It's
actually not even that popular among experienced developers trying to
port code from 2 to 3.

I'm sorry to hear that you're hitting these kinds of stumbling blocks.
If you have any particular questions or issues, please don't hesitate
to mention them here or to me off-list.

John Y.
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.