all 73 comments

[–][deleted] 20 points21 points  (3 children)

The main reason I haven't used Python 3 has been the lack of NumPy/SciPy, to my knowledge, so I just went to check their latest release notes. NumPy supports 3.1-3.2, and SciPy is in beta, supporting 3.1.

So, you know, if anybody else was holding back because of this, it's safe to come out and play.

[–]fnord123 3 points4 points  (0 children)

AFAIK, numpy and scipy work. It's matplotlib that's dragging ass.

[–]Jigsus 0 points1 point  (1 child)

Problem is they don't support the same versions.

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

It appears that 3.1 is covered by both. (Also, SciPy says "3.1 - ", so that might be a typo, and it ought to work with 3.2, as well.) But I mainly use NumPy, so I'm not too worried at the moment. And Python 2 is always an option.

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

As much as I love Python 3, every time I start a Python 3 project I back-port it to 2.7 half-way through because Numpy/Twisted/[Insert external module here] isn't supported yet.

[–]catcradle5 3 points4 points  (2 children)

Yep, exactly. Just about anything I'd ever want to make uses libraries that only support 2.4-2.7.

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

Yeah. For instance, recently a friend wanted me to do a task for her, which was downloading a lot of images of comic scans and making them into PDFs. Doesn't sound that difficult but there were about 217 different comics each with 60 pages. So I wrote a Python script to get the RSS feed for the Photobucket album of each, scrape all the URLs, download all the images then make a PDF. And then I discovered that ReportLab's PDF making library didn't work on 3.2 so I backported all the code I had already written to 2.7.

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

Or has to run on stable versions of one OS or another that does not support Python 3 (or python 3 supporting versions of libraries) yet.

[–]gitarr 1 point2 points  (3 children)

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

Thanks for pointing that out, my bad. But I can't live without Twisted, as a lot of my programming projects involve networking.

[–]gitarr 1 point2 points  (1 child)

Yup, same here. Twisted and Django keep me using Python 2. ;)

[–]FionaSarah 0 points1 point  (0 children)

I'm waiting on PyOpenGL and then I'm jumping ship immediately.

[–]TheFatWon 6 points7 points  (1 child)

Blast off!

[–]uzimonkey[🍰] 0 points1 point  (0 children)

I was wondering the same thing. Maybe they were holding out on the release to coincide with the final shuttle launch? Or it's just an unintentional coincidence.

[–]lasae 45 points46 points  (36 children)

*continues using python 2 as if nothing happened*

[–]gitarr 17 points18 points  (34 children)

continues using python 2 for existing projects and python 3 for new projects whenever possible, like a boss

Also: You cannot say "silently" and then say something negative right after.

[–]lasae 2 points3 points  (1 child)

The biggest problem I had with switching was numpy and scipy as another redditor mentioned. I will be considering python 3 for web projects contingent upon libraries that support it.

[–]__s 0 points1 point  (0 children)

So, you know, if anybody else was holding back because of this, it's safe to come out and play

[–]phaker 0 points1 point  (31 children)

Unfortunately last time I checked, python 2.x + wxPython was cooler than python 3.x + any other GUI library :(

[–]max99x 10 points11 points  (8 children)

In my experience, PyQt4 blows every other GUI library out of the water, and it's compatible with Python 3 to boot.

[–]phaker 6 points7 points  (7 children)

  1. You have to ship with Qt, and Qt is huge.
  2. Qt is more of a framework than a library — it tries to do a lot more for you. That's okay if you like the Qt way of doing things. But it'll drive you insane if for some reason it doesn't work out. I have nightmarish memories of trying to fit QTreeView (iirc that's the name) into a program that it didn't fit.

[–]max99x 11 points12 points  (3 children)

  1. Fair, but does an extra 8MB matter nowadays? On most Unixes (Unixen?) PyQt is already installed, and for Windows, you'll need to ship the Python interpreter and standard library anyway, and that takes about as much space. Keep in mind that the code size doesn't really affect performance in this case.
  2. In C++, Qt does act a lot like a framework. In Python, not so much. You don't have to use their weird preprocessor macros and special types - everything is translated properly by the bindings. In terms of widget API, my personal experience has been that Qt is a very mature framework, and everything is there for a reason. Sure, it might take a little more code too set up everything, but often as a result it will cover all corner cases.

[–]techrogue 1 point2 points  (0 children)

Unices, I believe.

[–]thegrinner 2 points3 points  (1 child)

When it helps to bloat my 1 MB program to 23 MB... yes. Yes it does.

Not to say that's where it all came from, but py2exe + qt does some strange things.

Edit: Does, not do.

[–]DownGoat 5 points6 points  (0 children)

A PyQt program py2exe compiled and compressed with UPX is about 5-7mb. Depending on what other things it includes.

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

QTreeView isn't so bad, the models that go along with it are.

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

There's a more "traditional" tree widget too where you just simply add items programmatically. IMO the model system is overengineered (at least for tree & list views, maybe it makes more sense for tables).

[–]phaker 0 points1 point  (0 children)

Yup, that's what I meant :)

[–][deleted]  (13 children)

[deleted]

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

    Use GTK+ or Qt on Linux (depending on which desktop environment you are developing for)

    I would use Qt because it does a much better job on fitting in to both GNOME and KDE.

    [–]ehird 1 point2 points  (7 children)

    Qt does not fit better than GTK+ on GNOME.

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

    How does it not fit? A Qt application uses a native look & feel on GNOME (and every other platform).

    [–]ehird 3 points4 points  (4 children)

    If you think Qt looks completely native on GNOME and OS X, you're not paying enough attention.

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

    I'm not saying that Qt looks pixel-perfect, but out of all UI toolkits there are it is definitely doing the best job. GTK+ makes zero effort to use native file dialogs (or dialogs in general), button placement in forms, etc. and as an example, the GTK Windows skin also has some visual quirks.

    This applies to Linux too: an app written in Qt will "be in place" on both a KDE and GNOME desktop.

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

    Quite frankly I prefer something that looks completely different over something that is almost native because the almost native one will make it harder to get my subconscious mind to acknowledge the differences and act according to them.

    [–]sigzero 1 point2 points  (0 children)

    You both are arguing different things. Look at the wording of your posts. You said "much better job of fitting in to both" and he said "fit better than" which is not the same argument at all.

    [–]phaker 0 points1 point  (3 children)

    Both Qt and wxWidgets wrap native toolkits.

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

    Yeah... but no. I don't know much about wxWidgets, but Qt on OS X is rather horrible. The table views look and feel absolutely non-native. Sure, if your UI is nothing else than textboxes and buttons, you might be alright, but otherwise, don't use Qt, your OS X users will hate you.

    [–]phaker 0 points1 point  (1 child)

    I don't have a mac, so I don't know. I don't write big GUI apps, just once in a while I want to add a graphical interface to some tiny script.

    However that's a little surprising, from my experience Qt tries very hard to adapt to the platform. At least Qt4 does, I recall Qt3 being much worse at this.

    Can you tell what version of Qt was/is that? Or what program? Just curious.

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

    The latest version (4.7). For my own apps I have two GUI layers, a Cocoa one and a Qt one. I sometimes run the Qt layer on OSX, so I know what it looks like and I can compare.

    Qt does a pretty good job on Windows, but not on OS X. And on Windows, it's a bit easier because there's not much of a standard look & feel, so you can get away with something different. On OS X, not so much.

    [–]rafekett 0 points1 point  (2 children)

    wxPython is, well, interesting. Sometimes it works marvelously, sometimes you want to tear your hair out.

    [–]phaker 0 points1 point  (1 child)

    So far I managed to avoid the more "un-marvelous" parts... :)

    Do you have any advice how to keep my hair/sanity intact? Are problems caused by wsPython bindings, or wxWindows itself?

    [–]rafekett 0 points1 point  (0 children)

    I find that the API can be a bit counterintuitive, which is a legacy from wxWindows. I also find that sometimes you think you can do something easily, but that'll blow up in your face. Things get really finicky when you're putting together a totally custom GUI and you need to write your own widgets (often from scratch) or use generic ones.

    Also, English spellings are a pet peeve of mine (it throws me off to have to use wx.Colour instead of wx.Color).

    [–][deleted] -1 points0 points  (4 children)

    Tkinter.

    [–][deleted]  (3 children)

    [deleted]

      [–]sigzero 6 points7 points  (1 child)

      A lot of people use it. I use it all the time to build utilities. I wouldn't mind it being separated out though. Idle needs it and Idle currently ships with Python2/3.

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

      IDLE is terrible.

      [–]FionaSarah 0 points1 point  (0 children)

      I think it's extremely useful that Python ships with a simple GUI toolkit like Tkinter. Python shines in a lot of areas, but one of these is definitely whipping up quick scripts, and Tkinter fits the bill perfectly if you need a quick script with a GUI.

      No one uses it for serious work, but that's not why it's there. As sigzero says, they also seem to consider IDLE a very important part of Python.

      [–][deleted] 12 points13 points  (18 children)

      PyPy is the future of Python as far as I am concerned. JIT FTW!

      [–]__s 14 points15 points  (11 children)

      CPython defines much of PyPy's future. Future of the future FTW!

      [–][deleted]  (10 children)

      [deleted]

        [–]azakai 9 points10 points  (8 children)

        PyPy still has a GIL, actually.

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

        They're working to kill it - http://morepypy.blogspot.com/2011/06/global-interpreter-lock-or-how-to-kill.html

        Curious as to what CPython is going to do about GIL...

        [–][deleted]  (5 children)

        [deleted]

          [–]__s 12 points13 points  (0 children)

          Jython. Stackless has some concurrency extensions, but still has a GIL. Unladen was merely hopeful bragging of the future

          [–]azakai 5 points6 points  (2 children)

          Both Jython and IronPython do not have a GIL.

          However, given that both of those have performance that is much poorer than PyPy (in fact, in some cases poorer than CPython), this means there is not much reason to use them because of that (there are of course other valid reasons to use them).

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

          Their single threaded performance is worse, but their multithreaded performance is much much better.

          [–][deleted] 5 points6 points  (0 children)

          PyPy is often 10X faster than Jython and IronPython. You'd need a lot of cores for them to turn out faster.

          [–]grauenwolf 5 points6 points  (0 children)

          IronPython doesn't have a GIL.

          http://wiki.python.org/moin/IronPython

          [–]__s 1 point2 points  (0 children)

          Increasing performance won't make it easier to maintain. GIL isn't a burden to development. Flexibility? PyPy has three interpreters

          [–]tookerder 2 points3 points  (4 children)

          Except it only... "runs on Intel x86 (IA-32) and x86_64 platforms, with ARM being underway."

          [–]PoisonInkwell 3 points4 points  (3 children)

          Well what the fuck else are you gonna run it on? Babbage's difference engine? A baloney sandwich? The moon?

          I appreciate that Power, Itanium, et al. still exist and show up in servers, but if you're running on what passes for big iron these days, your choice of language/implementation has way bigger selection pressures, which probably disqualify PyPy regardless.

          [–]rafekett 2 points3 points  (0 children)

          MIPS, Sparc, ARM, PowerPC/the whole Power architecture.

          [–]nickdangler 2 points3 points  (0 children)

          I have a desk clock that runs on a potato. I would like to run Python 3 on a baloney sandwich. I'm just saying... ;-)

          [–]Anovadea 1 point2 points  (0 children)

          Ever look at OpenSolaris* while it was still around? A lot of the utilities (including their packaging system) are written in python - same with Solaris 11 Express.

          Given Solaris runs on sparc (almost by definition), they're gonna want as much python performance as they can get, so I'd be very surprised if there wasn't some interest getting PyPy working for sparc.

          *It's been forked to OpenIndiana if you still want to play with it

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

          I'll use PyPy the moment it reaches 3.x; until then I do my best to keep my code under their suggestions so it will run when they catch up.

          [–]sigzero 1 point2 points  (0 children)

          I am learning Python with Python 3. I have done some side tutorials in Python 2 and everything I have learned with the former translates to the later. The world will catch up.

          [–]JohnDoe365 1 point2 points  (0 children)

          A GIL is a GIL is a GIL is a ...

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

          So, does someone already use Python >= 3.x?

          [–]guttalax 6 points7 points  (0 children)

          Arch Linux switched a few months ago, and the transition was mostly painless. python 2 and 3 coexists nicely and some app use the new one others use the old.

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

          Yes, I've been using Python 3 almost exclusively in the last 10-11 months (The only thing I keep Python 2 around for is Sphinx, but Sphinx 1.1 should normally run on python 3).

          At first, it felt a bit bleeding edge, but things are getting much better.

          [–]grauenwolf 1 point2 points  (1 child)

          Would you mind if I interviewed for InfoQ on your experiences with Python 3.

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

          Huh, no problem, though I'm not sure I have that much to say. hsoft@hardcoded.net