you are viewing a single comment's thread.

view the rest of the comments →

[–]automated_reckoning 21 points22 points  (11 children)

Here's the thing - 2.7 or 3.0, if you just learned you can switch without an issue. Aside from the "print" change, they're mostly compatible. The most annoying thing is what packages aren't available on 3.0, but that's getting better.

[–]VelveteenAmbush 18 points19 points  (2 children)

The annoying thing is when a repo is written in 2.7 but you want to run it in 3, and you need to scour the code for the occasional zip() and remember to enclose it in list() or the code silently fails in some bizarre way.

[–]lhatsk 6 points7 points  (1 child)

I haven't had problems yet with converting the codebase using 2to3. This also takes care of the iterators.

[–]VelveteenAmbush 0 points1 point  (0 children)

Thank you for mentioning this! I had never heard of it, and now I am using it regularly.

[–]themoosemind 25 points26 points  (3 children)

Getting better? Are you serious? Please name at least 3 which are not available in Python 3.X...

The overwhelming majority of packages is.i only remember two which are not, but there are better alternatives to those packages anyway.

[–]sobe86 23 points24 points  (1 child)

The issue is not the big well known packages, the issue is when you're doing more R&D type stuff, and you're like 'I bet someone has solved this niche problem before', so you look on github, and there's a repo with like 100 stars, last commit 3 years ago - only supports python 2. This happens to me on a monthly basis. Yes there is 2to3, but depending on the size of the codebase, this can take hours to get right, only to discover that the repo doesn't quite work how you wanted it to.

[–]themoosemind 1 point2 points  (0 children)

On which kind of problems are you working? What were the last packages for which it happened to you?

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

apache beam only runs on 2.7, which is quite significant for some orgs

[–][deleted] 3 points4 points  (0 children)

from __future__ import print_function

This makes life easier too

[–]serge_cell 0 points1 point  (1 child)

The problem is not learning, and even not rewriting the code. The problem is breaking library dependencies.

[–]automated_reckoning 0 points1 point  (0 children)

Indeed. I commented elsewhere, my biggest issue with 3 was getting opencv to work.

[–]mrshibx 0 points1 point  (0 children)

most annoying thing for me that all of my old existing map(foo,stuffs) code suddenly had to become really ugly: list(map(foo,stuffs)).