the python foundation will abandon python 2 on january 1 of the coming year.
a lot of us have known about this for some time. i knew a developer from nokia, who still prefers python 2. i prefer it, because it is a simpler language that google hasnt made "more enterprise." which doesnt mean you cant do enterprise applications with it.
when this topic comes up, people post the link to the pythonclock. i post the link to pypy.org instead.
python is a language, but what is being abandoned (no longer updated) is the python foundations python 2 interpreter.
i dont think everyone is going to just switch. absolutely, most distros will.
others will retain python 2 for some time, its not impossible for a group to even take it and fork it and maintain its security. if someone does, then there is no reason not to use python 2 if it is a better tool for the job.
to this day, not every library is ported over. some still require version 2. these will become rarer in use, but people will continue to use python 2 for these reasons. i heard the other day that someone is still using debian 5. i was still using debian 7, four years ago.
youre better off using python 2 than debian 5 these days. people have their reasons.
i have used pypy-- its a very solid python 2 replacement. its library support (for python 2) is not up to par, my main interest is getting pygame to work with pypy. if i can do that, it will be a suitable replacement. it works with pyglet, so i would consider (but not prefer) moving from pygame to pyglet.
i also have a version of my programming language that works with python 3, but as with the version of python itself, i really dont like the way strings work. its not the extra syntax for the print command, its the way they changed one of the most fundamental data structures.
as for the amount of time ive spent twiddling python 2 code to update it, its substantial. the reading i did was also substantial. its a lot of work, to support a move that i never approved of or truly found significant benefit from.
people forget, that if a user doesnt feel the benefit of your software-- just like someone who doesnt like the new ghostbusters film-- that blaming them for not liking it wont change a thing.
you can only give something so many chances before you have a pretty good idea its not for you.
there are other python interpreters. indeed, there are several. at brown university, they teach you how to implement the python language, among other things.
while the python foundation has made it clear what direction they want to go in, expecting everyone to line up that hasnt already is like expecting everyone to run out and get high when they legalise marijuana.
most of the people who were going to have done so already. yes, this will push people farther along into a version of python they clearly dont want, or isnt for them at this time.
many years theyve tried, for me all they would need to do is add from __past__ import strings.
for those who instead want to use python with braces, ive already got a solution for that. its not even the first one or the best, and that should tell you something about options.
http://pypy.org/compat.html
if you dont like mandatory indentation and want to code python with braces, simply code like this:
Code: Select all
for p in range(10): {
if p > 5: { print("\{")
print( p ) } }
then pipe the code through the following python script:
Code: Select all
#!/usr/bin/env python2
# coding: utf-8
#### license: creative commons cc0 1.0 (public domain)
#### http://creativecommons.org/publicdomain/zero/1.0/
proginf = "python with braces, feb 2019 mn"
from sys import stdin, stdout
from os import name as osname
nl = chr(10)
if osname == "nt":
nl = chr(13) + chr(10)
indent = 0
igwhite = 0
buf = ""
esc = 0
doublenl = 0
for p in stdin:
stdout.write(chr(32) * 4 * indent)
for each in p.lstrip():
# prevent spaces between braces from messing with indents
if igwhite:
if each in (chr(32), chr(9)):
each = ""
else:
igwhite = 0
# you must escape all braces that are not syntactic
if buf == chr(92):
if esc:
if not each in "{}":
stdout.write(chr(92))
esc = 0
else:
if each == "{":
indent += 1
each = nl + (chr(32) * 4 * indent)
igwhite = 1
elif each == "}":
indent -= 1
each = nl
igwhite = 1
# these escapes arent brace related, so emit
else:
if esc:
stdout.write(chr(92))
esc = 0
if each != chr(92):
stdout.write(each)
stdout.flush()
else:
esc = 1
buf = each
# dont let indents concatenate
if not p.lstrip():
stdout.write(nl)
if esc:
stdout.write(chr(92))
esc = 0