So wait... should I continue with or start relearning everything through the lens of ? I don't understand what the real difference is. The only work I've done with has mainly been minor syntax differences

@poetgrant isn't that kind of what it comes down to? Minor syntax changes?
I remember changes to the gil, but i supposed those are handled behind the screens. And a lot of code is written to be compatible with both python versions anyway :)

Then what's the point? Does have something more sexy than 2? If so that's cool, but I think I might just stick to 2 because I am still learning it... hehehe

@poetgrant @vancha No no, don't learn 2. Support will be dropping soon, and encoding in 2 is a cluster*** (and takes 4x more RAM). Learn 3, even the author of learnpythonthehardway has updated his stuff now and agrees it's superior.

I saw that he updated... so 3 means less RAM usage? That is almost enough for me... the one thing I hate about Python is how much friggin' ram it uses for larger scale scripts... heck even the little scripts use a lot of ram

@poetgrant well yes, if you work with strings it'll probably have an impact. Look at Synapse: they went from 2 to 3 and had almost 4x less ram usage and 50% less cpu usage (granted, Synapse may not be the best example of highly optimized software, but still)

Damn... this is goig to suck... I will have to relearn everything...

@poetgrant It's not sooo bad, and syntax isn't important anyway, the venn diagram of (programming) and (no Internet) have almost no intersection 😉

I think when I see my script eating 25 MB of RAM it just drives me nuts because if that script was written in most other languages it would be more like 9 MB of RAM. I know it doesn't matter to.most people because they won't notice, but it frustrates me that Python was my first and most fluent language(no I'm not actually fluent)

@Matter @poetgrant exactly, you'd just use python3 like you used python2. Programming in it is "almost" exactly the same.
Just pretend it's still python2. Just that it's actually 3..

@poetgrant @vancha Learn the latest major version of Python available at any given time. Python 2 is like Python 3, but bad; they corrected several poor design decisions in Python 3, and those are uncorrected in Python 2.

@poetgrant At work my colleague is in the process of moving everything to Python 3. The time to move is now (for us, at least).

@poetgrant python3 became less “scripting” and more “programming” language, with all caveats. It has pretty different type system compared to python2, from 3.6+ adds type hints, from 3.4+ adds asynchronous operations (based on things existed in python from 2.4), also map, filter return now generators and so forth.

It became way more complex yet it takes way more memory and CPU compared to python2...

@poetgrant Yes, you should absolutely use Python3 for any new code, unless there's a very compelling backward-compatibility reason not to.

The improved built-in support for Unicode is reason enough on its own.

@apetresc @poetgrant "very compelling" in this case is really only applicable to two specific scenarios:

1) you deploy your project(s) on systems out of your control where you only have Python 2 available and no means of fixing it.

2) you have a FAANG-scale project written in Python 2 which depends on libraries that have not and will not be ported.

For literally every other scenario you should update yesterday.

@poetgrant Yes, use only Python 3 for new stuff. The big difference is full Unicode support, doing that right in 2 was insanely hard. 'print' being a function in 3 is kind of a trick to make you re-examine your old string code.

I have to say... I should.have posted about this a year ago when I first started looking at 3

@poetgrant @mdhughes Honestly you will find the migration a lot easier than you expect.

@poetgrant Definitely move up with the times if you can. It's better in the more evolved variants of most languages. Especially the ones that are better supported with more refined features.

[ here comes the unsolicited recommendation ]

You could also break out of the cycle for a while and play around in Godot with GDScript. Python-like and you can build things MVC style and have some fun while you are at it.

Sign in to participate in the conversation

Fosstodon is a Mastodon instance that is open to anyone who is interested in technology; particularly free & open source software.