On Wed, Apr 13, 2016 at 1:57 PM, Justin Dearing <zippy1981@xxxxxxxxx> wrote:
I must respectfully disagree with learning python 2.7 first.
I believe your respect is sincere, so I appreciate it.
But my recommendation isn't a "greenfield" one. You might call it a
"greenscreen" one instead. ;)
You see, my entire recommendation is founded on the following premises:
(1) You are learning Python with the intention of using it on the i.
(2) IBM's Python is either not in the cards at all, or is in the distant future.
Given those things, any Python code you write for the i (at least for
quite a while) will be run using iSeriesPython. And that is an
implementation of Python 2.7, with little or no prospect of ever
having a 3.x version.
Now, I can accept that reasonable people will still disagree with my
recommendation. But learning Python 3 first will mean you either can't
transfer that knowledge to the i for a potentially long time (you have
to wait until your shop gets IBM's Python), or you will have to learn
Python 2 in order to use Python on the i (because all you have is
iSeriesPython). Or you simply just won't use Python on the i after
all.
To me, the least bad of the available options is to learn Python 2.7
and start leveraging iSeriesPython right away.
My recommendation is completely different if you don't care about
using Python on the i, or if you do plan on installing IBM's Python
soon.
Regarding conversion of Python 2 code to Python 3:
Some of the small open source ones need to be updated, but its not very
hard. A one or two line change, and you make a new friend on github. There
is a cheat sheet that will lay out all the issues for you:
http://python-future.org/compatible_idioms.html
For some things, it's very simple indeed. For others, it's very much
not. If the package in question is *fundamentally designed* around
Python 2's loose byte/string model, then porting it is going to be
tough, and may well require a deep redesign, not just syntax tweaks
here and there.
The world does not need more greenfield python 2.7 code at this point.
The field which is the IBM midrange platform is a very strange color
that is only partly green.
John Y.
As an Amazon Associate we earn from qualifying purchases.