[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ale] Slightly OT: System default python version
- Subject: [ale] Slightly OT: System default python version
- From: philip at turmel.org (Phil Turmel)
- Date: Thu, 25 Jan 2018 10:13:01 -0500
- In-reply-to: <[email protected]>
- References: <[email protected]>
There are some big differences in handling strings and byte arrays that
will eat one's lunch. There are quite a few built-in functions that
were removed in v3 and/or changed to be quite different.
I highly recommend "Practical Python porting for systems programmers"
by Peter A. Donis and Eric S. Raymond.
http://www.catb.org/esr/faqs/practical-python-porting/
That document offers some strategies for making your python code
compatible with both v2 and v3. It is not simple.
On 01/24/2018 06:03 PM, Todor Fassl via Ale wrote:
> I got a question from a student who is using python. "I'd rather not
> hard code in any python version. Is there any reason to have the system
> default be 2 instead of 3?"
>
> He had asked me to install the python-matplotlib package. I was like,
> "Are you sure you want python-matplotlib and not python3-matplotlib?" He
> is still coding in python2.7 instead of python3 but not by choice. Is
> there such a thing as a system default python version? To program in
> python3, doesn't he have to modify his code?
>