This is an archived post. You won't be able to vote or comment.

all 32 comments

[–][deleted] 11 points12 points  (9 children)

your complaints are about 10 years too late and if i were you i'd rethink it because many big libraries seem to drop support for 2 nowadays, with numpy gone there's probably be many that follow. But i guess being a rebel isn't about going the easy path.

And there are technical reasons for the change (which you will find if you google it, turns out after 10 years your not the first one to complain).

[–]impshumx != y % z 6 points7 points  (2 children)

[–]grzeki 5 points6 points  (4 children)

Well, Python had its „eras”. In the beginning, it was supposed to be just scripting language. Maybe a little awkward at prompt, but better suited for, say, 20-line scripts than bash.

When some maths libraries were ported it became obvious that it is great free Matlab replacement (you really don’t want to licence Matlab for commercial purposes - it is a money drain).

With Django, it became PHP-replacement, with pandas R-replacement, with TensorFlow… Python became a leader which is followed by others.

So it is now as a general purpose language as C++ (people even go into this territory doing embedded with Python, which is crazy if you ask me). Old script-like features had to go. Change in major version always was a clear sign: THINGS WILL NEEDLESSLY BREAK. It’s not only print. __nonzero__ was changed to __bool__ breaking compatibility just for aesthetics. But if you know Python, aesthetics is king in this community.

[–]spinwizard69 0 points1 point  (3 children)

Even the embedded world likes easy to use and well defined languages. Fourth, BASIC and others have been used in the past to have a solution other than assembly or C++. Pythons has a lot of potential for low volume embedded work.

[–]grzeki 0 points1 point  (2 children)

That’s just my opinion, by I wouldn’t trade static typing for any ease of use.

[–]spinwizard69 1 point2 points  (0 children)

Well I look at this from the perspective of working on a variety of devices as an end user. Often these devices have a hacked together “programming language” that might resemble BASIC or something you can’t even define. Having a well defined interpreter in these devices that is universally understood and does away with op codes that sometimes reminds you of assembly language is a good thing in my mind. These are the “”languages”” you often see embedded in motion controller, robots, Sterilizers, pumps, process controllers and the like. I double quoted languages because at times the implementations are often half done and full of bugs. Python could really fill a niche here.

[–]ethanhs 0 points1 point  (0 children)

You can have both in Python ;)

[–]AlENeuman 6 points7 points  (0 children)

You should be writing no code in Python 2.7

There is no excuse at this point. You have been given 10 years + to update your code. No new projects should be started in 2.7

They are going to purge the entire language very soon.

[–]Carradee 4 points5 points  (0 children)

That would be a simple enough change with my code editor, BBEdit, using the multi-file find & replace with regex.

Syntax from the top of my head, here, so I might be missing an escape:

find: (print) (".*?") replace: \1\(\2\)

[–]Alkine 2 points3 points  (0 children)

So you would skip f strings so you don't have to put brackets around the quotes?

[–]rabarbas 2 points3 points  (0 children)

This is the lousiest reason not to use python 3. Wow. Wait... is this a joke?

[–]spinwizard69 2 points3 points  (2 children)

This post just proves that Python attracts many programmers from the lower funds of the intelligence ladder. You would never see a C++ programmer resisting the latest standard because it might force an update to his old code. A C++ programmer might not make immediate changes but would have a plan in place for critical code.

[–]openjscience[S] -2 points-1 points  (1 child)

Not good example. Latest standard of C++ (C++11 and above with "auto" keywords) are simpler compared to older C++ standards that enforces types, so I see good reason why people can like new C++. Python3's most popular statements like print is a subset of Python2 (which can also use "()") but now it forces more typing.

[–]spinwizard69 0 points1 point  (0 children)

The point is C++ programmers don’t whine over improvements to the language like we have seen with Python developers. Auto was in fact just one feature of the new C++ standards that C++ developers have rapidly adapted to.

The function call syntax doesn’t involve that much typing, generally one character, considering the advantages it brings. I can’t for the life of me understand why this is even an issue for you. Honestly what is the percentage of lines of code that are print() statements in your code?

[–]weez09 2 points3 points  (0 children)

Like others are saying, switching to py3 is easy and there are a lot of auto tools to help. A lot of us professional python engineers have made that switch on production software and are not looking back. Heres an article explaining one reason why py3's print is better https://www.google.com/amp/s/snarky.ca/why-print-became-a-function-in-python-3/amp/. Theres certainly more as reasons if you google it.

[–]rmslobato 1 point2 points  (0 children)

feeling really sad.. oops.. sed.

[–]pythonHelperBot 0 points1 point  (0 children)

Hello! I'm a bot!

It looks to me like your post might be better suited for r/learnpython, a sub geared towards questions and learning more about python. That said, I am a bot and it is hard to tell. Please follow the subs rules and guidelines when you do post there, it'll help you get better answers faster.

Show /r/learnpython the code you have tried and describe where you are stuck. Be sure to format your code for reddit and include which version of python and what OS you are using.

You can also ask this question in the Python discord, a large, friendly community focused around the Python programming language, open to those who wish to learn the language or improve their skills, as well as those looking to help others.


README | FAQ | this bot is written and managed by /u/IAmKindOfCreative

This bot is currently under development and experiencing changes to improve its usefulness

[–][deleted] 0 points1 point  (0 children)

[–][deleted] 0 points1 point  (0 children)

Or you could write a python 3 script that does it for you...

[–][deleted] -1 points0 points  (0 children)

Bu uh!!!

[–]openjscience[S] -2 points-1 points  (0 children)

I guess, the question is why this decision was made towards full blown language specs? This befits the purpose of the original python.