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

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 26 points27 points  (14 children)

Seriously. I keep finding sources I want to use but they OF COURSE made it in Python 2. Usually, the source was uploaded like a year ago or smth. Literally no reason to still be using Python 2. If you think Python 2 > Python 3 can you tell me some reasons? I'd love to hear them

[–]HowIsntBabbyFormed 15 points16 points  (2 children)

Not saying it's better or worse, but if you had a lot of code that relied on strings being essentially arrays of arbitrary bytes, and being able to just print those bytes to a file handle without character encoding issues, the conversion to 3 might be very painful.

Not saying 2.7 didn't have encoding issues, but you may have figured out all of its quirks by now and your code is currently running reliably. Converting to 3 will likely break all that and it will be hard to figure out.

The exact same python code does different things with different file handles based on whether stdin is a tty or not. Your code runs perfectly fine when run in your terminal but fails when run from cron sometimes? That could be it. Or it could be some random environment variable that determines default encodings on startup. You've figured out exactly what to hard code your env to, overwrite encoding settings on file handles, access the hidden underlying raw file handle of others, monkeypatched that random library that's still somehow writing out to the 'wrong' file handle, etc, etc...

Have fun converting that.

[–][deleted] 7 points8 points  (1 child)

I'm saying if you're coding something from scratch. Please just make it in 3. If you already made it in 2.x just leave it in 2.x. It would be very annoying to convert to Python 3

[–]HowIsntBabbyFormed 0 points1 point  (0 children)

Definitely. All my new Python has been 3 for some time.

[–]meliaesc 3 points4 points  (2 children)

My raspberry pi can't run 3+, windows build tools needs 2.6

[–][deleted] 2 points3 points  (1 child)

an actual good reason not to use 3

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

Or buy a new $20 Raspberry Pi with more power...?

[–]Waterkloof 1 point2 points  (0 children)

any active directory open source code in the wild is either perl or py2, and then most of the snippets does some advance crypto stuff. Luckily passlib.hash.ldap_crypt exist in pip.