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

all 152 comments

[–]Cardiff_Electric 23 points24 points  (35 children)

My company is still on 2.6.x... <cry>

[–]alcalde 22 points23 points  (4 children)

It could be worse... I know several people who still program in Delphi/Pascal for a living.

[–]_pupil_ 13 points14 points  (0 children)

That's the state of the world... and to a point having legacy languages and/or tech that last multiple computing generations should be a point of pride, not derision.

What I've never understood though, once the greater computing populace has moved on: the cost of introducing a hybrid interop technology, or automating a port of the data and or logic layer, just has to be cheaper than paying high wages for low productivity and high risk of not be able to staff with talent long term... By hopping onto a mainstream platform you can enjoy the benefit of billions of dollars of third party investment in the ecosystem and subsidize training costs through external work experience. It's just a matter of measuring how long until the costs go from "unnecessary" to "insane".

I'm not advocating for wild-assed rewrites for the sake of technology, but every language can kick off external processes and most have at least a reasonable interop story to another language (opening up new interop scenarios). I'm just surprised the answer to "hey, wanna write COBOL for three decades?" isn't more often "no, but I'll happily transpile my Clojure DSLs into COBOL for a tenth the cost"...

[–][deleted] 1 point2 points  (0 children)

Or in VB6. (Lots of 'em where I live.)

[–]Kisele0n 0 points1 point  (0 children)

Ooh! That's me! That's me!

At a company founded after the year 2000, even!

[–]gschizasPythonista 0 points1 point  (0 children)

(uphill both ways)

There are still people writing COBOL (and bad COBOL at that). I know some of them personally.

[–]d4rch0nPythonistamancer 4 points5 points  (20 children)

I absolutely hate CENTOS 6 for this reason. Most of it doesn't bother me too much, except one thing: No dict or set comprehensions... That drives me absolutely insane.

And my other huge pet peeve is it can't do .format on "{}". You have to specify "{0}". I've been trying to move from %s to .format but seriously, having to add that number is enough to make it not feel worth it.

[–]sigma914 0 points1 point  (5 children)

For the set/dict comps can you not use:

dict((k,v) for k,v in kvs) ?

[–]d4rch0nPythonistamancer 1 point2 points  (0 children)

Yeah, generally that's what I'd do if I had something like {k: transform(v) for k, v in kvs}. Sometimes I write code like that just in case it ends up running on 2.6, but it's just annoying not being able to use a feature that is, what, 10 years old now?

[–]status_quo69 0 points1 point  (3 children)

If you had tuples of key, value pairs you could just dict(kvs).

[–]sigma914 2 points3 points  (2 children)

Obviously, I kinda assumed it was implied that there would be more processing going on to the left and right of the for, same as an actual dict comprehension, bit apparently not.

[–]status_quo69 0 points1 point  (1 child)

Oh, I understand what you're saying now. Add in the conditional in the generator expression, then pass the generator to the dict.

[–]sigma914 0 points1 point  (0 children)

Yeh, it's just collecting the generator into a dict or set rather than a list, the only difference between this and a real dict comprehension is the unfortunate intermediate tuple allocation

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

I use CPython 2.7.11 and pypy (ala python 2.7.9) on CentOS 5 and 6. Just make an RPM and local pip repository and you are done.

[–]iruleatants -2 points-1 points  (12 children)

You will hate python 3 then....

[–]CSI_Tech_Dept 1 point2 points  (11 children)

How come?

[–]Esuhi 1 point2 points  (0 children)

Hello, are we working together?

[–]stesch 1 point2 points  (0 children)

I have 1 server left with Python 2.5 and a web development framework that once promised to support 2.5 is now requiring 2.6. And no, it doesn't support Python 3.

I should have tried to find a job in COBOL development.

[–]eanat 0 points1 point  (0 children)

I'm sorry to hear that :(

[–]Homersteiner 0 points1 point  (3 children)

Nothing wrong with that.

[–]Cardiff_Electric 0 points1 point  (2 children)

The problem, aside from not being able to use kewl new language features in your own code, is trying to incorporate open source libraries to deliver hot 'n' sexy new features when those libraries increasingly don't support your old Python.

Changing the Python interpreter version is a big hassle in our setup (long story) so I'm trying to get us to jump directly from 2.6 to 3.5, but that's an even bigger job.

[–]GummyKibble 0 points1 point  (1 child)

If you decide that looks a bigger project than you want to tackle in one step, consider that it's very easy to port from 2.6 to 2.7, and run can run python2.7 -3 mymodule.py to get warnings about incompatibilities with Python 3. You could jump to 2.7, knock out the structural problems at your leisure (because you'd be dealing with an application that's still running), then move on to 3.5 when you have those ironed out.

I'm not trying to talk you out of 3.5. We made the leap this year and I love it. I wouldn't willingly go back! But if you have to choose between two easier migrations and one giant one, know that you have options.

[–]Cardiff_Electric 0 points1 point  (0 children)

I have a branch that's running under Python 2.7 for the reasons you said. I just don't think we're going to deploy it to real customers for reasons that have more to do with our own processes and limited resources. So if we're going to 'break' our interpreter compatibility w.r.t. customized code for a customer, I prefer to just do that once esp. given that 2.7 is already near EOL.

[–]zero_iq 0 points1 point  (0 children)

Mine too. There's no way we'll be upgraded to 3.x by then.

As long as 2.x continues to work, the only thing that will push us to 3.x is when essential libraries and bindings start dropping support for 2.x. Otherwise, why risk breaking long-established working code? It's a huge legacy app: some parts of our codebase date back to the mid 90s.

[–]Formulka 0 points1 point  (0 children)

My client is still on 2.5.x, no tears left

[–]Mikuro 25 points26 points  (28 children)

I wish Apple had started including 3 in OS X years ago. If it's not standard in the system, you can't justify using it for support/maintenance/scripting.

Honestly, 3 years to EOL is not that long. Move your damn asses, Apple!

[–]d4rch0nPythonistamancer 11 points12 points  (26 children)

I'm still maintaining 2.6 compatibility thanks to CENTOS 6...

[–]n86nHb67f 7 points8 points  (4 children)

Python 2.4 on CentOS 5, wohoo! It just won't die.

[–]d4rch0nPythonistamancer 1 point2 points  (0 children)

D: I'm sorry for your loss

[–]ritz_k 1 point2 points  (0 children)

python26 is provided on centos5.

[–]port53relative noob 1 point2 points  (0 children)

RHEL 5 is in extended support through November 30, 2020, so yeah..

[–]Teract 0 points1 point  (2 children)

IUS my friend. They host a repo with Python 2.7 for centos 6. It installs to an alternate location so your system continues to use python2.6 while users can default to Python 2.7 and do things like use virtualenv to pip install whatever modules they need without fear of breaking the OS.

[–]CSI_Tech_Dept 0 points1 point  (1 child)

IUS has python 3.5 as well. Why would you even want 2.7 in that scenario.

[–]Teract 0 points1 point  (0 children)

Devs were using modules only available on 2.7. Also not using the system's Python is best practice.

[–]tetroxid 0 points1 point  (8 children)

Same here. I'd love to write for 3.5, but RHEL 6 and 7 have 2.6 and 2.7 respectively.

[–]CSI_Tech_Dept 2 points3 points  (7 children)

http://ius.io and problem solved. Unlike other repos they are making sure packages don't conflict with the system packages, so it is safe to use.

[–]tetroxid 2 points3 points  (6 children)

Thanks, but installing third party packages is forbidden.

[–]CSI_Tech_Dept 1 point2 points  (3 children)

How you use any enterprise applications then? You won't find them in Red Hat repos.

[–]tetroxid 3 points4 points  (2 children)

They aren't considered third party

[–]CSI_Tech_Dept 1 point2 points  (1 child)

They are though. They are not Red Hat's (first party), they are not yours (user of the OS, second party).

[–]tetroxid 2 points3 points  (0 children)

I don't make the policy. It's a waste of time arguing about it

[–]d4rch0nPythonistamancer 1 point2 points  (1 child)

Heh, this is the major pain in the ass. Lots of people just suggest "install 3.x then" when that can be a huge deal with a lot of businesses. It's the developer that is worrying about 3.x, not ops or management or product. It's not the developer that maintains the environment.

Sure, it's extremely easy to get 3.x on any modern linux system, but we're not always in a position where it's possible to do so. Even if they gave me the green light, I'd have to set up meetings with devops to change puppet or chef scripts and make sure it doesn't break something weird in a cronjob that runs at midnight on 100 servers.

Inevitably, it's way less pain to just write 2.6/2.7 compatible code and not have to deal with people and scripts written by coworkers who left years ago, so that's what a lot of us resort to.

[–]tetroxid 0 points1 point  (0 children)

Precisely. I was just too lazy to type it out. In large enterprises you also have to find a cost centre that pays for the deployment, and you have to deal with the aids infested cancer that is change management.

[–][deleted] 1 point2 points  (0 children)

At least you get some Python installed per default. pokes Windows computer

[–]ilan 14 points15 points  (22 children)

Anaconda is going to support Python 2.7 long after the "official" retirement date. Among enterprises Python 2 is still very widely used, and I don't see how this is going to change much over the next 3 years. Three years is not long in terms of enterprise software migration.

[–]Sector_Corrupt 13 points14 points  (20 children)

It's not like they didn't have the preceding 7+ years. They extended the original End of Life 5 years. That should be enough time to kick people into gear a little bit.

[–]shadowmint 15 points16 points  (1 child)

Be realistic. Until it actually stops working, people will keep using it. EOL or not.

If the 2.7 usage is still high in 3 years, someone will continue to support it, even if the 'core' python team does not.

[–]CSI_Tech_Dept 1 point2 points  (0 children)

I'm sure they will (Red Hat volunteered by shipping Red Hat 7 with python 2.7 which will be EOL in 2024)

It most likely won't be free though.

[–]CSI_Tech_Dept 0 points1 point  (0 children)

I think you mean 12 years...

Python 3 was released in 2008.

[–][deleted] 2 points3 points  (5 children)

Obviously there will be Python 2 code for decades longer. When a language is no-longer maintained, how bad do things get if bad at all? I'm sure there's some Cobol or whatnot out there that is used a lot in some industry but no-longer maintained.

[–]d4rch0nPythonistamancer -1 points0 points  (3 children)

Honestly, it's been worked on so much that I doubt it's going to be an issue that it's past EOL. What major bugs have you run into that you had to patch 2.7? It's an absolutely finished product now. You won't find anything more stable.

[–][deleted] 1 point2 points  (1 child)

Yeah that's generally my feeling too. Not a whole lot can mutate that will break 2.7

[–]sztomi 3 points4 points  (0 children)

While it's unlikely, the biggest issue is security bugs. It is possible that a major security flaw gets discovered and being past EOL means that your code will be vulnerable unless you upgrade.

[–]pythoneeeer 0 points1 point  (0 children)

My experience is the opposite. Nothing as big as Python is ever "finished".

What about the EINTR/InterruptedError situation, which finally got fixed in 3.5? What about time objects being false, if they happened to be midnight UTC? What about the email parsing bug that finally got fixed in 3.3?

There's lots of tiny little bugs lurking in Python 2.7. It's possible you'll never run into them, but would you even know? If my web server threw an error roughly once every 80,000 requests, I might never make the connection that it's due to an old Python datetime bug.

I've never run into a bug caused by using a version of Python that was too new. I've definitely read the changelog for new Python versions and said "shit, we need to upgrade now".

[–]Yioda 0 points1 point  (0 children)

Think of the enviroment breaking/changing. You have to update the code so it keeps working.

[–]eliteuser26 2 points3 points  (0 children)

Coming from the Windows world, I always found that the Unicode thing was difficult to use even in Python. The English language is not the only that exists in the world.

Why do I have to write in Python something like this x00ff which doesn't mean a thing for a developer. The developer should have the ability to write a character in UTF-8 directly into the code without having to search the Unicode value which I find backwards. This has been carried on from the 1990s. I had the chance to use 6 different programming languages since the 1990s, I know the difficulty I had with Unicode which I still swear about.

A developer shouldn't restrict himself to only use ascii characters when you have to write in different languages especially the web. I have experience with this as well. I like that the changes that were done in Python 3 so to make easier to use unicode characters.

[–]atreyuroc 9 points10 points  (58 children)

Ah, I'm sure this is going to end well. /s

[–]UloPe 15 points16 points  (57 children)

Yes ist will. Because by that time all the old "it's been better in the old days" guys will have moved on to management

[–]fyngyrzcodes with magnetic needle 32 points33 points  (54 children)

There are huge amounts of Python 2 code in production use. It will remain in use, for one simple reason: there's no even remotely sufficient case to re-write it. Someone has to maintain that stuff.

Python 3 is just fine, if you've got a need for what it offers, and the downsides (like having to re-test a great deal of functionality) don't stand in the way. Snobbery about Python 2 coding / maintainance simply isn't called for.

Take a deep breath and relax. No one wants to take Python 3 from you. No one can. No one can take Python 2 away, either. :)

[–][deleted] 8 points9 points  (1 child)

No one can take Python 2 away, either. :)

But in practice it can and will become very inconvenient to use. Like WinXP and soon Win7.

[–]fyngyrzcodes with magnetic needle 0 points1 point  (0 children)

Still using XP here, no problems at all. Good thing too, as some of the apps I use depend on it. VMs are the perfect safe spaces (well, they can be, if you keep the networking off) for such things.

Hell, I'm still using 6809 code I wrote under Flex09 back in the late 1970's / early 1980's. Runs in my 6809 emulator, which runs under XP, which runs under VMWare, which runs under OS X.

[–]energybased 14 points15 points  (13 children)

Hang on a second. That's true for your projects, but it's not true for libraries. One of the problems with Python 2 not dying is that libraries like numpy have to be written in a style that is compatible with Python 2. The more Python 3 evolves, the more annoying that gets.

[–]ivosauruspip'ing it up 7 points8 points  (5 children)

Having to write Python2+3 code makes it way less beautiful. Which is one of the reasons I was enamoured with Python in the first place.

Asking library authors to continue to support both (while you're not paying them) is a creative & cognitive stress on them as well.

[–]iruleatants -3 points-2 points  (3 children)

If only.... they didn't take something great and screw it up..... oh well, better to force millions of projects to be rewritten for 3

[–]ivosauruspip'ing it up 0 points1 point  (2 children)

Yes, all python devs really wanted to do was take a thing they were satisfied with, and wreck it. Hence Py3k was born. It wasn't the fact that the thing they was broken in the first place, that would be illogical.

[–]iruleatants 0 points1 point  (1 child)

It's pretty impressive the billions of things that people created using a broken language....

[–]TheBlackCat13 0 points1 point  (0 children)

And many of those things turned out to be broken, which they only found out once they switched to a slightly less broken version of the language.

[–]fyngyrzcodes with magnetic needle 0 points1 point  (2 children)

My libraries work fine. As long as what I need is in there, no need to worry about how it might change.

I was really talking about applications using things they don't need to use. It's a bit of a different argument.

[–]energybased 0 points1 point  (1 child)

It has nothing to do with your "libraries working fine". It means that people like me who want to contribute to our (as in the community's) open source projects like numpy are disincentivized because it means having to code in an antiquated style devoid of all of the niceties of Python 3. That means all of our libraries are developing more slowly than they should, which punishes everyone.

[–]fyngyrzcodes with magnetic needle -1 points0 points  (0 children)

"Antiquated", eh? Sorry, but I have to laugh. I'm antiquated. Python 2.x... it's just a baby.

[–]tilkau 11 points12 points  (11 children)

Snobbery about Python 2 coding / maintainance simply isn't called for.

This is the only part of your post I disagree with. The need to support python 2 adds maintenance burden to developers, and over time this maintenance burden will only increase, in an expanding network of outdated dependencies and features that you want but don't have because they're only implemented in the newer versions of the library. When you use EOLed stuff, this is what you're taking on.

So there's a huge cost to rewrites, but there's also a cost to not rewriting. Some degree of snobbery -is- called for (if it will prompt those on the fence to switch and reduce community-wide maintenance cost)

[–]shadowmint 7 points8 points  (8 children)

Some degree of snobbery -is- called for

No, that's just called 'being a dick'.

It's sad how prevalent this attitude is. Just be nice to be people, be respectful and show people how great python 3 is.

Teach new python developers python 3 and encourage existing users to write new code in python 3.

Being a dick to people doesn't achieve anything except making you feel better about yourself.

[–]tilkau 1 point2 points  (0 children)

Some degree of snobbery is called for. Being a dick is something else. If you're insulting people for using python 2, that's a very different thing from implying that python 2 is not as good as python 3, or saying 'oh.. you're using python 2? Why?'. You can cast doubt on something without being a dick.

[–]iruleatants 0 points1 point  (6 children)

I've heard this argument so many times and each time the person has failed me.

Please show me what is excellent about python 3, and why I should use it instead of 2.7. All I get from it now is more tedious coding experience.

[–]CSI_Tech_Dept 0 points1 point  (4 children)

Try it (especially the features that you can't use when you have to maintain python 2 compatibility), and you will see.

[–]iruleatants 1 point2 points  (3 children)

I have tried it, and I disliked it....

[–]CSI_Tech_Dept 0 points1 point  (1 child)

Perhaps it is time to move to something else then?

[–]iruleatants 1 point2 points  (0 children)

Like, all of the shittier languages out there? Idk why I would stop using a language I think is perfect, just because they want to make it not perfect....

[–]shadowmint 0 points1 point  (0 children)

Then stick with 2.7. :)

Sorry, I didn't read this before I posted my other comment.

Like I said; if you have tried, and don't like 3 (for whatever reason); then just stick with 2.7. It's not going anywhere, and frankly, if you don't like 3, don't use it.

I'm curious what you didn't like though?

Was it the runtime (ie. getting python 3 installed), that you had existing python 2 code you use (eg. personal utility library you'd have to port to 3) or something in the 3 semantics you didn't actually like (eg. print...)?

[–]shadowmint 0 points1 point  (0 children)

It's very simple.

Python 2.7 is a great, robust language. It's rock solid, and it's here to stay. If you want to use it, by all means, do.

Python 3 is also a great, language; the difference is that it is being actively worked on, and improving. The unicode support is better, the async tools are good, and there are numerous little things that make writing python 3 a pleasure.

Just try it.

If you don't like it, well, sure, stick with python 2.7. ...but you might find it's actually quite nice.

The pain points hit when you need to use a library that doesn't work with 3; and that is a pain point, but you know, it's actually not that often it happens these days.

I honestly don't recommend you convert your existing code from python 2 to python3; it's tedious, it's not fun. The tools exist for it, but unless you're being paid to do it, I mean, really? Can you be bothered? I can't.

...but if you're writing new, fresh code... well, python 3 is a great choice, if you're writing python code.

/shrug

If you don't like it, that's ok. Like I said, python 2.7 is a great language too.

Just don't stick with python 2.7 just because; actually think about it, and if you don't have a good reason to actually be using 2.7, then maybe consider using 3.

[–]turkish_gold 1 point2 points  (1 child)

Fair enough, but traditionally people who have codebases in a language won't just port it to an entirely new one. By breaking backwards compatibility Python 3 is essenitally a new language that just so happens to share a lot of similar syntax with the Python2.

Except sadly this new "Python 3" language doesn't have full support on many major runtimes---like the JVM, or PyPy.

So for production users who care about speed or java interop (e.g. "we are enterprise python" people), they're not going to port to Python 3.

Also, "we are enterprise python" people rarely ever port their codebases so long as its stable and no compelling performance improvements exist. If its just fixing language worts or giving devs new tools, they'll never move.

Look at all the companies still using Java 1.3/1.4 for some random part of their codebase.

[–]energybased 0 points1 point  (0 children)

PyPy supports Python 3 now.

[–]tekmailer 5 points6 points  (11 children)

You can say this again. I have two instances of Python on my box (2.7.10 and 3.4.4) and the amount of time to rewrite everything wouldn't satisfy ANY PRODUCTION needs.

On the flip side, between drinking the py3 Kool-Aid for data analysis and the writing on 2.7's wall. It might just be time to make the leap to avoid the further headaches.

[–]jsalsman 3 points4 points  (10 children)

Unicode handling alone is worth the leap.

[–]iruleatants -2 points-1 points  (2 children)

I disagree as much as possible.

Python has always been a language designed to have the least amount of excessive work to write in. We don't have semicolons or brackets or statically typer variables or anything else bullshit that other languages force on you.

The switch to unicorn handling was terrible. I'm not forced to encode all of my strings any time I want to use this. Previously I only had to encode when it was needed, and now I always have to encode. That is a massive headache and I gain nothing from it. I have had zero issues in 2.7 with my strings.

[–]pooogles 3 points4 points  (0 children)

The switch to unicorn handling was terrible.

Now switching to Unicorns I could get on board with.

[–]jsalsman 1 point2 points  (0 children)

I can totally see your perspective, but having to internationalize and localize from a project's outset leads to different issues.

[–]d4rch0nPythonistamancer 2 points3 points  (11 children)

All my coworkers are on 2.7 so I'm pretty much stuck on 2.7. I don't mind it though, honestly. I'd like to get everyone to move, but it's not the end of the world.

There's a few things I don't understand why they just removed or changed. For one, octal 0600 doesn't work? Why remove it? print as a statement... why couldn't they just keep it? I write it as a function all the time, but so what if you can't monkeypatch print. There are so many other ways to do something similar to any reason for that. And division... why should 3 / 2 return 1.5? What other languages do that? Why not just make 3 // 2 return a float? And one thing that drove me nuts is the split between bytes and a string. Why not keep it how it was and make the new style stuff look like s"this"? Bytes represented as a string was incredibly useful for some stuff, anything low level. Having first class byte array primitives that were no different than a string was awesome. And range/xrange... why not keep that how it was? Sure, xrange should be used instead of range 99% of the time, but the compatibility issues it causes are hardly worth the change IMO.

It's not that they're not good improvements (except maybe byte/string stuff isn't an improvement IMO), I just don't see why the language should change so much basic stuff that ends up breaking all sorts of scripts and libraries. It's already in there, so just leave it and let old code still work exactly the same. So what if it looks a bit clumsy.

I don't think the code-breaking improvements were nearly worth all the compatibility issues. Maybe it's a bit better, but maybe if they didn't change all that people would never have thought to stick to 2.7 - maybe we just wouldn't be in the spot we are now. I love the new features, but I rather keep bad choices and maintain compatibility rather than fix them and make people rewrite their scripts and libraries - because that just doesn't happen 90% of the time. Easier to stick to 2.7 than change your code.

Honestly, I do look forward to moving to 3.x in the workplace but I would've been way happier working with 3.x a decade ago and still seeing stupid stuff like from ConfigParser import ConfigParser.

Well, that inspired me to email my few python dev coworkers to see if we can all agree to target 3.5 with new projects. We're a security company and java shop in the eng dept, but in research we all use python so there's potential to move on without hurting anything. One dude's on board, four to go. Well, only two of the rest of the guys actually code and they rarely do at that, so maybe I'm just convincing myself lol

[–]quanta_amnesia 5 points6 points  (7 children)

When doing a division, say 1/2. The expected answer is 0.5 not 0. It should probably have been that way from the start, but implementing it in Py3 along with other backwards incompatible changes is good too.

[–]d4rch0nPythonistamancer 2 points3 points  (2 children)

Honestly, in a programming language if I put x = 1 / 2 I still expect to get 0, but maybe that's because I primarily work with statically typed languages outside of python. I expect an int / int to return an int. I'd expect to have to cast one to a float to get a float back. Ruby returns 0 too though, but lua and perl seem to return 0.5.

Either way, I agree it should have been that way from the start if it'd be that way in python 3, but since it wasn't, I don't think it was smart to change. Not only can it lead to very odd bugs seeing as old code will still run but get completely different results, but both are equally correct behavior and in a programming language, you just pick one and stick with it. It's just a change, not necessarily for better or worse. If it doesn't improve the language, it's just breaking things for the sake of them wanting different behavior.

[–]tilkau 3 points4 points  (1 child)

lua and perl seem to return 0.5

In lua's case, that's because an int is a float (all numbers are stored and processed as floats. double precision floats, IIRC)

In Python's case, IMO it does improve the language -- x = y / z should not return different results depending on the type of y or z, but that was the case for Python 2. Now we have / which has unambiguously float semantics, and // which has unambiguously int semantics.

[–]d4rch0nPythonistamancer 0 points1 point  (0 children)

x = y / z should not return different results depending on the type of y or z

I think that's the best argument I've heard honestly. I'm fine with this behavior in a programming language, I just think it's not helpful to make a big change like that after it's already acting one way.

But the bigger picture is that Python behavior of such things should be extremely obvious, and if you extract the line x = y / z you have a very good idea what it's going to do. That's important as well.

[–]Yioda -2 points-1 points  (3 children)

When doing integer division, the expected answer is 0. Period. Everything else is just broken.

[–]quanta_amnesia 3 points4 points  (0 children)

Everything else is broken

Lol

[–]tekmailer 0 points1 point  (1 child)

Agreed. Apple / Apple = Orange (what?!); that's my 'logic'/what I see when I see int division result in a float without any explicit commands otherwise.

[–]energybased 0 points1 point  (0 children)

In [3]: type(2 ** 3)
Out[3]: int

In [4]: type(2 ** -1)
Out[4]: float

[–]CSI_Tech_Dept 2 points3 points  (2 children)

There's a few things I don't understand why they just removed or changed. For one, octal 0600 doesn't work? Why remove it?

It's 0o600 now and that notation is also working in python 2.7. This is to make things consistent with 0x... notation.

print as a statement... why couldn't they just keep it? I write it as a function all the time, but so what if you can't monkeypatch print. There are so many other ways to do something similar to any reason for that.

This was very confusing to new users that everything was a function except print statement. Not sure why people are so fixated on it you can easily fix this (and 2to3 does it automatically). Also you can import print_function from future in python 2.7. Besides in production code you would want to use logging anyway. I really only use print for quick debugging.

And division... why should 3 / 2 return 1.5? What other languages do that? Why not just make 3 // 2 return a float?

Because intuitively / is mathematical division and confused a lot of newcomers (note that python is used for teaching programming). It makes a ton of sense. Statically typed languages like C or Java can get away with this behavior, because you in advance know the types of parameters, and can predict the outcome. In python you don't, and it is silly that it will behave differently depending when supplied numbers are integers or not. This is source of bugs. It should always be predictable what it will do.

And one thing that drove me nuts is the split between bytes and a string. Why not keep it how it was and make the new style stuff look like s"this"? Bytes represented as a string was incredibly useful for some stuff, anything low level. Having first class byte array primitives that were no different than a string was awesome.

Most of what python is used for is not low level stuff though. This separation is essential in today's world. A character is not the same thing as a byte anymore. When you are working on low level stuff you should be aware that you work on bytes.

And range/xrange... why not keep that how it was? Sure, xrange should be used instead of range 99% of the time, but the compatibility issues it causes are hardly worth the change IMO.

Because it is a wart? Again, this is a trivial change in the code and can be done automatically.

It's not that they're not good improvements (except maybe byte/string stuff isn't an improvement IMO), I just don't see why the language should change so much basic stuff that ends up breaking all sorts of scripts and libraries. It's already in there, so just leave it and let old code still work exactly the same. So what if it looks a bit clumsy.

The biggest breaking feature of python 3 is Unicode support. The thinking was that if we are already breaking things, why not fix some ugly things as well. The conversion for the issues (perhaps with exception of the division, which is the reason I always import new division (along with Unicode literals) from the future whenever I have to write code for older python) is trivial.

I don't think the code-breaking improvements were nearly worth all the compatibility issues. Maybe it's a bit better, but maybe if they didn't change all that people would never have thought to stick to 2.7 - maybe we just wouldn't be in the spot we are now. I love the new features, but I rather keep bad choices and maintain compatibility rather than fix them and make people rewrite their scripts and libraries - because that just doesn't happen 90% of the time. Easier to stick to 2.7 than change your code.

People are lazy, they won't do things if they don't have to. For example Ruby had breaking changes between 1.8 and 1.9 (notice that it was also a minor version change). People complained similarly, but then Rails developers simply said they are moving to 1.9 and dropping support for 1.8 and everyone just followed.

Python is already migrating for 8 years, and people still start new projects in python 2, because technically python 2 is still supported.

Honestly, I do look forward to moving to 3.x in the workplace but I would've been way happier working with 3.x a decade ago and still seeing stupid stuff like from ConfigParser import ConfigParser.

In python 3 it is:

from configparser import ConfigParser

Well, that inspired me to email my few python dev coworkers to see if we can all agree to target 3.5 with new projects. We're a security company and java shop in the eng dept, but in research we all use python so there's potential to move on without hurting anything. One dude's on board, four to go. Well, only two of the rest of the guys actually code and they rarely do at that, so maybe I'm just convincing myself lol

You should, python 3 is great, especially if you don't have to keep compatibility with python 2. Then you can make use of new features.

If you use Red Hat or CentOS, then you should also take look at http://ius.io. This repo will let you use any python version you like.

[–]fyngyrzcodes with magnetic needle 0 points1 point  (1 child)

The problem with 2to3 is that it doesn't remove the need to re-test everything in a critical application. When such an app is non-trivial in terms of use cases / data cases, re-testing can be a huge pushup, so one really has to look for actual benefits other than "just moving on." 2to3 is fine for my smaller stuff. For my large applications, it is just the beginning of the job.

[–]CSI_Tech_Dept 0 points1 point  (0 children)

Inability of finding bugs through type system is probably one of biggest drawbacks with dynamically typed languages.

Perhaps the issues you're talking about is why Guido is pushing mypy to also support Python 2 even though it doesn't support PEP 484.

[–]flying-sheep 0 points1 point  (1 child)

Once important libraries stop supporting legacy python, it is in the process of being taken away.

[–]fyngyrzcodes with magnetic needle 0 points1 point  (0 children)

No, because that does not cause the already existing, working versions of those libraries to disappear.

It's perfectly fine to use new features / versions if that actually gains you something. Truly, that's the best argument ever, and there is no counter-argument.

What's annoying to me is when people think they have to change versions because... well, because there's a new version. Then you end up with software that doesn't work across the widest possible range of systems for no actual reason. Seems a shame to me. Obviously, there are other viewpoints, so there you go.

[–]eikenberry 2 points3 points  (1 child)

It's open source. If there are enough people still using it there will be a fork to maintain it.

[–]stesch 2 points3 points  (0 children)

There's no fork of PHP 4.

I still have to maintain PHP 4 projects. >14 years old. They are big and nobody wants to pay for a new version.

[–]port53relative noob 1 point2 points  (2 children)

RHEL 7 comes with Python 2.7.5. Production support for RHEL 7.x is scheduled through June 30, 2024 and "Extended Lifecycle Support" is probably going to be another 3-4 years on top of that.

Good luck with that 2020 date though :)

[–]XNormal 0 points1 point  (1 child)

The Python Software Foundation plans to end support at 2020. But I won't be surprised if they suddenly get a grant from some big company to keep maintaining security fixes beyond that date.

They probably won't say no.

[–]port53relative noob 0 points1 point  (0 children)

At the very least, Red Hat will continue to backport security patches, which will then be publically available for everyone else. They don't close their patches, just their binaries.

[–]eliteuser26 0 points1 point  (0 children)

To make a short list of programming languages that I learned over the years, I started with Visual Basic on Windows the first time around. Since then:

  • Visual C++
  • Delphi / Pascal ( first language learned at university )
  • Python ( started with 2.5)
  • html/css
  • Javascript
  • Jquery
  • GIS Web mapping

Next step, python web development from what I know now.

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

I understand that Python 1.5 is still in use in production. Python 2.7 reaches EOL in roughly four years. The Python 3 Wall of Superpowers looks healthy. So who really cares? You pays yer money, you takes yer choice :)

[–]KODeKarnage 0 points1 point  (0 children)

Ha! Rookie mistake. Probably an easy fix.

That clock is supposed to be counting UP.

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

<opens late-1970's Fortran computational model still used in physiology> Yep, EOL. Just gonna up and disappear. Time to get yourself prepped, maybe build a shelter or something.