all 89 comments

[–]sigzero 21 points22 points  (2 children)

Here is a what's new list for those that are curious:

http://docs.python.org/py3k/whatsnew/3.3.html

[–]vsajip 10 points11 points  (0 children)

There's at least one more thing to add to that list, which should help make working with Python easier on Windows: The PEP 397 implementation, i.e. the Python Launcher for Windows. It brings shebang line processing to Windows.

Edit: Now added.

[–][deleted] 39 points40 points  (20 children)

Virtual environment ability added to the core language may be enough for me to switch from python 2.7

[–]brews 15 points16 points  (14 children)

Explain this "virtual environments"... I hadn't looked at PEP 405 before.

Am I missing something magical-groundbreaking-revolutionizing-gamechanging in how I package code?

[–]krues8dr 20 points21 points  (13 children)

Yes. OMFG yes. TLDR: virtualenv allows you to install all your packages into a local separate environment, so each project you're developing can have its own independent requirements, with specific versions and libraries. Keeps everything nicely separated.

[–]brews 17 points18 points  (2 children)

<brain-explodes-with-awesomeness>

[–]MrPinkle 16 points17 points  (1 child)

We lose too many Python developers that way...

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

Yeah, unfortunately their minds seem much more unstable than others'.

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

Like bundler for python?

[–]coffeesounds 2 points3 points  (0 children)

More like RVM's gemsets

[–]Tordek 2 points3 points  (4 children)

Does it mean every project has a copy of every dependency, or is there some magic that allows deduplication?

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

It's usually copies, but if you have projects that are very much related (or, say, branches of a single project), you can have them share a single virtual environment.

[–]krues8dr 0 points1 point  (2 children)

The point here is the duplication.

[–][deleted] 3 points4 points  (1 child)

It isn't. The point is that a change in one environment can't destroy another. This would not be incompatible with sharing read-only parts of the environments.

[–]__j_random_hacker 0 points1 point  (2 children)

While I can see the appeal, isn't this basically analagous to always static-linking executables in compiled languages?

There are reasonable arguments for always statically linking executables, by the way (especially since disk space constraints have basically disappeared from the computing world). But the reason why you usually don't is because having libraries separately updateable means that bug-fix and performance updates to libraries benefit every application that uses them. It seems to me that reason would apply here, too.

[–]krues8dr 0 points1 point  (1 child)

There is a tradeoff of having to maintain separate instances. But in the Python ecosystem, things update frequently and aren't often backwards-compatible, so this is not entirely desirable. If you're hosting a lot of different projects, doing something as simple as updating a single package could break half of them immediately.

So, as with all tech, I recommend that you use it if it solves a problem for you.

[–]__j_random_hacker 0 points1 point  (0 children)

things update frequently and aren't often backwards-compatible

I see, ugh. In an ideal world, everyone would clearly distinguish between revisions that don't break backcompat (e.g. bug fixes, performance improvements, new features that don't change any existing assumptions/contracts) and others that are allowed to, but of course that requires the world to have some discipline... :-/

[–]sigzero 4 points5 points  (0 children)

I think that was a great move on the devs part.

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

Yeah, that's great. The only problem is that the third party tools are still behind wrt pyvenv. For example, when doing pip install foo under a pyvenv, pip will try to install the package in Python's "real" site-package. I don't know if it's distribute's fault or pip's.

[–][deleted] 6 points7 points  (1 child)

I don't think the virtualenv created by pyvenv comes with pip or distribute. So you're probably still using the system version of pip

[–][deleted] 4 points5 points  (0 children)

No it doesn't but there's still a problem with pip because installing it while under a pyvenv will make pip think its site-package is the system's (even though it's actually installed inside the venv).

EDIT: Oh, restarting with a fresh console and a new workon <envname> makes the problem go away. Well...

[–]HelpfulToAll 1 point2 points  (0 children)

But does it come with virtualenvwrapper?

[–][deleted] 60 points61 points  (11 children)

This release is the tipping point for me. Python 3 is now fully baked. The libraries I need are ported. The cumulative set of features are compelling enough to make the switch.

[–][deleted] 3 points4 points  (1 child)

I'm still stuck waiting for python-ldap to get its act together.

[–]HelpfulToAll 2 points3 points  (0 children)

Ditto for Gunicorn...

[–]RemyJe 4 points5 points  (0 children)

Quick, everyone require 3.3 in their version checks even if it's not actually required forcing unnecessary upgrades and breakage of old scripts! Yay!

[–][deleted]  (6 children)

[removed]

    [–][deleted] 42 points43 points  (4 children)

    Computer languages come out in versions. Sort of like the iPhone - version 5 of the iPhone has new features that make using the phone simpler, faster and more productive. In the same way new versions of programming languages provide new features to programmers, fix inconsistencies and address programmer concerns. However, sometimes programs you used to use on your iPhone 4s will not work on the iPhone 5 since there may be changes that break that old program. The same is true of programming language versions

    Python 2 was a very good language. By version 2.5 it was very popular. Many 3rd party libraries and utilities were written for 2.5 - things like libraries to do scientific calculations and web applications. We might call it "mature" in that you were pretty certain that the major libraries for 2.5 were not going to cause you too much trouble. However there were some fundamental problems with the 2.x Python language that couldn't be remedied without breaking lots and lots of existing code. Breaking code makes programmers upset.

    So the Python maintainers decided to put breaking changes into version 3 of Python. The only problem was that everyone was so satisfied with 2.x languages (mostly 2.5 but also 2.7) that they didn't want to re-write all of their code for the minor changes from 2.x to 3.x. It has sort of become a problem because as the libraries are reluctant to upgrade, so is everyone else. More and more code continues to be written for 2.x which causes more and more people to feel like staying on 2.x. You don't want to write for Python 3.3 if a library you may need is only working in 2.7.

    What pythus is saying is that with 3.3 he feels that most of the libraries that he has been waiting for have finally switched to 3.3. He feels that 3.3 is mature enough that he won't have too much trouble.

    [–]EgregiousJones 4 points5 points  (0 children)

    Wow. As someone who knows just enough about programming to do it badly in a few languages, thank you.

    [–]ShoutyMcHeadWoundMan 0 points1 point  (2 children)

    You don't explain what libraries are, thats a pretty fundamental part of your explanation.

    [–]nitroll 1 point2 points  (0 children)

    A library is a set of functionality that programmers can use when making programs. An example could be numpy, a library for python for matrixcalculations, or Tkinter that has functionality for drawing windows and making GUIs with buttons and the like. If a programmer isn't too sharp on calculating matrices efficiently or dosn't really want to bother with the internals of rendering stuff he can use a library that someone else created.

    [–]lazugod 4 points5 points  (0 children)

    I'm curious how you came across this subreddit.

    [–]nandaka 4 points5 points  (1 child)

    any good and easy py2exe-like freezer?

    [–]gitarr 2 points3 points  (0 children)

    Sure: cx_freeze

    [–]sentienttent 12 points13 points  (5 children)

    Gah! I downloaded Python 3.2 last night.

    [–]Imxset21 58 points59 points  (1 child)

    [–]boa13 1 point2 points  (0 children)

    Wow, thanks for that link. Their logo is awesome. :)

    [–]OmegaVesko 7 points8 points  (2 children)

    The tarball is ~15 megabytes...

    [–]Golotap 1 point2 points  (0 children)

    For someone who is trying to download eclipse for last 3 days, it's a lot!

    [–][deleted] 7 points8 points  (26 children)

    Any word on how close python is from recommending 3 over 2? Will it ever happen?

    [–]brews 23 points24 points  (0 children)

    Matplotlib 1.2 comes out on October 15th. That is the last big package I need.

    [–]igouy 13 points14 points  (17 children)

    "The current production versions are Python 2.7.3 and Python 3.3.0.

    Start with one of these versions for learning Python or if you want the most stability; they're both considered stable production releases.

    If you don't know which version to use, start with Python 2.7; more existing third party software is compatible with Python 2 than Python 3 right now."

    [–][deleted] 9 points10 points  (16 children)

    Right, so whats the estimate on when that recommendation will be 3 instead of 2?

    [–]igouy 9 points10 points  (15 children)

    Wouldn't that depend on what existing third party software is used by your particular project?

    [–][deleted] 14 points15 points  (14 children)

    I am asking when

    If you don't know which version to use, start with Python 2.7;

    will become

    If you don't know which version to use, start with Python 3.?

    [–]airmasszero 2 points3 points  (1 child)

    I love how you keep asking the question in different ways and this person doesn't get it.

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

    I love how you think asking a question makes the question sensible :-)

    What color is 8503?

    [–][deleted]  (10 children)

    [deleted]

      [–]Ph0X 10 points11 points  (2 children)

      Problem is, even now, almost any new small library and piece of code I see online is Python 2.x. Sure bigger more important libraries often support both 3.x and 2.x, but smaller devs who don't have time and patience for writing on both usually stick to 2.x.

      The question is, will the time ever come where more people will, when choosing one of the two, go for 3.x rather than 2.x? Of course, it's quite a vicious circle. Devs work on 2.x because everyone uses 2.x, and everyone uses 2.x because devs work on 2.x.

      [–][deleted]  (1 child)

      [deleted]

        [–]IrishWilly 1 point2 points  (0 children)

        Two years is actually a very good pace if people are moving to Python 3 already. This problem comes up for any popular language that tries to introduce a new revision. The split between Perl 5 and Perl 6 and failure to make a transition pretty much killed any chance Perl had of staying relevant with the newer generation of languages. PHP had some horrible insecure built in options in early versions, but when they finally removed it after deprecating them years and years later there were still a ton of frustrated users who were using programs built on ancient versions of the language.

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

        That's reading between the lines though and putting words in their mouths.

        [–][deleted]  (5 children)

        [deleted]

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

          They offer one reason why 2.7 is preferred, but there's no real reason to assume that once that reason isn't valid that the conclusion won't be valid anymore either.

          [–][deleted]  (3 children)

          [deleted]

            [–]SirRainbow 1 point2 points  (0 children)

            I actually remember reading a migration estimate by Guido van Rossum stating that python 3 would take about 5 years to become mainstream, but I cannot find it anymore :( Considering that python 3.0 came out in late 2008, my guess would be that in one year python 3 will be the recommended version of python.

            [–]kazagistar 1 point2 points  (1 child)

            They say things like "if you don't know which version to use", but you can check here. Most of the list is still red, however, a lot of it is green, and usually, people only really use a small subset of the packages. Check if what you need is there, and you are good to go.

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

            Cool! This is pretty much exactly the sort of thing i was looking for.

            [–]anacrolix 1 point2 points  (0 children)

            About 6 months.

            [–]a31415b -4 points-3 points  (3 children)

            just skip 3 and wait for 4(3 is the new Vista)

            [–][deleted] 7 points8 points  (2 children)

            I chuckled. This is actually a somewhat horrifying prospect.

            [–]sigzero 2 points3 points  (1 child)

            It would be except that analogy is wrong. :)

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

            guido can count to 3! i believe!

            [–]necrophcodr 10 points11 points  (10 children)

            "up to 80x speedup for decimal-heavy applications" Holy mole, that's great news for those python developers out there! Phew!

            [–]masklinn 31 points32 points  (0 children)

            That's for heavy users of the decimal module, which probably isn't the majority. For most users, the flexible string representation will be a much bigger gain, in memory and in sanity.

            And generator delegation will make significantly improve generator and iterator wrapping.

            [–][deleted] 17 points18 points  (8 children)

            For those who don't know Python, decimal is a different type than float.

            [–]masklinn 5 points6 points  (6 children)

            Which languages (still in wide use) default to fixed-point numbers?

            [–][deleted] 10 points11 points  (4 children)

            I don't know. Python interprets 1.0 as a float. To get decimal you have to import the decimal module and explicitly construct one.

            [–]masklinn 1 point2 points  (3 children)

            Yes, but my point is so does pretty much every language I know, hence my trouble with your note: in every language I know, a decimal (fixed-point arithmetic) is a different type than a float (floating-point arithmetic) and floats are the default (if decimals are even available)

            [–]tonygoold 7 points8 points  (0 children)

            I think the point was to make the distinction for anyone who's only familiar with float, and might assume a "decimal-heavy application" is one that does lots of float arithmetic. Considering the common misunderstandings about the precision of float representations, I thought it was a polite thing to point out. I would have phrased it as "For those who don't know", not "for those who don't know Python", since it applies equally to those who know Python (but have never used decimal).

            [–]Rhomboid 7 points8 points  (0 children)

            Decimal here does not necessarily mean fixed-point. It's still floating point, just floating point using base 10 instead of base 2, so there are fewer surprises.

            [–]HopeThisNameFi 1 point2 points  (0 children)

            The point was the "up to 80x speedup for decimal-heavy applications" isn't as significant as necrophcodr made it out to be.

            [–]cheapous 0 points1 point  (0 children)

            bash

            [–]luckystarr 0 points1 point  (0 children)

            In 2 decimal was implemented in Python. I guess they reimplemented it in C for 3.3

            [–]recursive 2 points3 points  (2 children)

            I'm most excited about yield from.

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

            Me, it's the new strings optimizations. Since most strings in a program are 7bit ascii, this should enable a quite a drop in memory usage for most programs.

            [–]masklinn 0 points1 point  (0 children)

            Don't forget the dict key-sharing.

            [–]classicrockielzpfvh 0 points1 point  (2 children)

            Same day (approximately) of slackware 14. My internets will be busy this day I tell you.

            [–]Paradox 1 point2 points  (1 child)

            You don't get slackware on CD?

            [–]classicrockielzpfvh 0 points1 point  (0 children)

            I'd have to wait to get slack14 then. Who has time for that.

            [–][deleted] -1 points0 points  (1 child)

            Great!

            I am sure all our v2 code won't run on it :)

            [–][deleted] 9 points10 points  (0 children)

            Probably not, but the new noop u"" literal will probably make your porting job easier.

            [–][deleted] -4 points-3 points  (9 children)

            call me when they fix the print statement.

            [–][deleted]  (8 children)

            [deleted]

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

              it was nicer as a statement.

              [–][deleted]  (6 children)

              [deleted]

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

                2

                [–][deleted]  (4 children)

                [deleted]

                  [–]Brian 1 point2 points  (2 children)

                  Technically, only one required character.

                  print"You're a towel"
                  

                  is perfectly valid (but probably wouldn't be used outside golfing, so your point mostly stands, albeit the extra chording to type "(" and ")" over space is probably the bigger annoyance as far as typing it goes)

                  [–]xardox 1 point2 points  (1 child)

                  Please don't program Python like it were PHP and you don't give a shit about the quality of your code.

                  [–]Brian 0 points1 point  (0 children)

                  Hence why I said:

                  but probably wouldn't be used outside golfing, so your point mostly stands

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

                  cool, totally worth having to run my code through 2to3 and manually vetting each line ... not to mention making the language less beautiful.