6 ms·
Python 3.3.5 has been released
- null_ptr 13y agoSo what's the deal with Python these days? Do people still write for 2.7 which is the default "python" in most (all?) Linux distributions, or is it safe to write for python3 now?
- wylee 13y agoI think it's pretty safe to go with Python 3 for new and/or personal projects. I started moving all my stuff to Python 3 a few months ago and Fabric is the only major project I use that hasn't been ported.
- viraptor 13y ago> Do people still write for 2.7 Yes. > which is the default "python" in most (all?) Linux distributions Most distributions ship both 2.x and 3.x at the same time. Ubuntu ported most (all?) of its tools to 3.x already. > is it safe to write for python3 now? What do you mean by safe? It's been stable for a long time now. As long as you verify all your dependencies work, you should be fine. The only annoying thing you may run into is a situation where only one of the versions is provided: for example if you want to drive ufw (3.x only) from salt (2.x only), you'll have to resort to some kind of IPC instead. There was a poll about the current state a month or two ago on HN.
- wfn 13y agoAlso, python3 is the default in archlinux: https://wiki.archlinux.org/index.php/python https://wiki.archlinux.org/index.php/python
- stefantalpalaru 13y agoArch Linux is an exception because they blindly follow upstream.
- raverbashing 13y agoYes, Python 3.3 is absolutely fine, I wouldn't bet on 3.2 or anything earlier though.
- yeukhon 13y agoYes. Like any other Python 2 releases, there are always new syntax and function additions. I think the only major Python library people use not available on Python 3 is Twisted. (edit: I think Mercurial is also not compatible with Python 3 IRRC due to byte-string and unicode incompatibility). Even Tornado and pyCurl works with Python 3 (according to pypi and doc). Before you start writing in Python 3, make sure your dependencies will run on Python 3.
- leobelle 13y agoTwisted is a library you might want to use if you want to write non-blocking code. So you would care a great deal if this wasn't python 3 if you wanted to use python 3. Mercurial is an application you use to version control your source. I'm not sure I understand why any python developer would care if Mercurial was written in python 2 as long as it worked. Maybe if someone was writing a Mercurial plugin or patching Mercurial they would care.
- erichurkman 13y agoOutdated packages matter insofar as that you must maintain a working 2.x install alongside your 3.x if you use tools that need 2.x. Hopefully these start disappearing, as Ubuntu and Arch have already moved to 3.x.
- leobelle 13y agoThis has very little to do with Python developers deciding between version 2.7 and 3.x. If you wrote a library or an app in Python 3.x packagers should require the appropriate version of Python as a dependency. Sam with v2. Developers shouldn't worry about that.
- nostrademons 13y agoPython 3.4 comes with asyncio, which takes a lot of the ideas of Twisted but forward-ports them to the standard library with cleaner language support. So for new projects, Twisted shouldn't hold you back - just use the standard lib. For legacy Twisted projects that are thinking of porting it's still an issue.
- rogerbinns 13y agoAmazingly people still use Python 2.3. With source downloads you can't tell what platforms use, but you can with binary downloads. One of my projects is a Python wrapper for SQLite (APSW) for which I also provide compiled Windows binaries for every Python version from 2.3 to the latest, and 64 bit for some of them too. It is very amusing to me that some people want the latest SQLite while using a positively ancient Python version. Google code shows download counts so you can get an idea of popularity of each release for Windows developers: https://code.google.com/p/apsw/downloads/list?can=1&q=&colspec=Filename+Uploaded+DownloadCount https://code.google.com/p/apsw/downloads/list?can=1&q=&colsp... I've since moved the project to github which doesn't show the download counts for releases. https://github.com/rogerbinns/apsw/releases https://github.com/rogerbinns/apsw/releases
- ambiate 13y agoWe still use python2.0-2.5. Various versions for various libraries. It is hell.
- zem 13y agodefinitely not all distributions, arch has 3.x as default and 2.7 as python2
- thomasahle 13y agoIt's actually getting a lot better. Many distributions ship python3 as the default python now, and even libraries like numpy and interpreters like pypy support it.
- deleted 13y ago[deleted]
- est 13y agoI hope CPython could introduce more performance improvements, not just bug fixes and alternative features.
- alialkhatib 13y agoThat'd be nice, but since CPython is supposed to serve as a reference implementation (and not necessarily be the bleeding edge of speed) I don't hold much hope of performance improvements becoming a top priority (except to make Python3 more compelling than Python 2.x strictly on performance criteria, which they've largely accomplished if I understand correctly).
- est 13y agoSo CPython think performance is about politics, but tell you what, it's also about competition. Every new Ruby release has some kind of performance tweak, Rubinius got rid of GIL entirely, Nodejs and V8 is significantly faster than pure Python, Go is one of the fastest.
- rectangletangle 13y agoThe widespread use of generators in 3 helps with performance. And the new asyncio in Python 3.4 should help with IO bound applications. If that isn't enough there's PyPy, a JIT compiled Python implementation.
- lucian1900 13y agoExcept PyPy is Python2, so that won't help either. If you want performance, Python 2 and PyPy is what you're looking for.
- dalke 13y agoIf you want performance and Python 3, and are willing to contribute funding and wait a bit, then PyPy is what you're looking for. :)
- eddd 13y agoGuido can release python 7, and still minority will use it, since many libs (https://python3wos.appspot.com/ https://python3wos.appspot.com/) are not ported to python 3.
- makmanalp 13y agoThat list sure is turning greener and greener every day. It's getting harder to use that as an excuse. I think my next project, I'll start using py3. The main big ones I see are boto (has a partial 3k fork that isn't official yet) and mysql-python (looks pretty dead, shame). Quite a few others like Gevent and supervisor, for example, have py3k ports nearly done, and mostly await merging.
- rodelrod 13y agoMysqlDB was holding me back from Python3, but that problem was settled with Oracle releasing a Python connector for MySQL [1] that works for both Python 2.x and 3.x. It's a solid and very complete library and it's DB-API compliant, so that migrating from MysqlDB can be pratically seamless. [1] https://dev.mysql.com/downloads/connector/python/ https://dev.mysql.com/downloads/connector/python/
- makmanalp 13y agoI've looked into that, have you seen any performance regression due to the fact that it's pure python?
- rodelrod 13y agoThat's a very good point. I tend to drop down quickly from the ORM to do SQL level optimization on hot spots, and that is the case of the applications where I have used this connector. Also, we are talking about entreprise applications with relatively low number of requests, albeit a lot of them resource intensive. In this context, the performance of the connector is not critical. I can tell you that it is good enough that I didn't have to change my usual architecture choices for performance reasons. Your case may be different. edit: changed grammar for clarity
- daGrevis 13y agoI started new project on Python 3 yesterday and I can say that there hasn't been any problems so far. Libraries I needed to use were compatible with Python 3: toml, markdown and Jinja2. I'm looking forward to use clint for better CLI as well! Everything was solid and production-ready. It's good to know that some really weird things are fixed in new Python. I can't think of any reason not to start new app in Python 3! :)
- mildtrepidation 13y agoI can't think of any reason not to start new app in Python 3! Sorry, but my recent experience has not matched yours, so the fact that this particular project had no library compatibility issues does not mean they no longer exist. I'm glad you found a project you can use it on. That just doesn't mean much to those of us who are still hitting the same familiar issues with it.
- daGrevis 13y agoYes, libraries that you may need may not be compatible yet. But it is fair to say that situation is getting better. Also, here's a great tool that checks if you can use Python 3: https://caniusepython3.com/ https://caniusepython3.com/ .
- raverbashing 13y agoUnless you depend in a big library that doesn't support Python 3 (and they're getting rare), I would suggest moving Then the ones left behind can be adapted, tested, or alternatives found, and the whole ecosystem can move on. If we keep using Python 2 to be safe nothing will change. Using Django and Python 3 and so far it's been a breeze, with minor bumps.
- cm127 13y agoWanna get people to really start using Python 3? Make it the default version on Ubuntu LTS. https://wiki.ubuntu.com/Python/3 https://wiki.ubuntu.com/Python/3
- rlpb 13y agoPython 3 is already available by default on Ubuntu. The page you link to refers to the removal of Python 2 by default, which is a separate thing, since both can be installed at once. As for making Python 3 the default if you type "python", this is unlikely to happen, for compatibility reasons: http://legacy.python.org/dev/peps/pep-0394/ http://legacy.python.org/dev/peps/pep-0394/
- rcxdude 13y agoYeah, Arch does this and it breaks so many things (any PKGBUILD which involves python will have some hack or another to fix things).
- hit8run 13y agoPython 3.4.0 final: March 16, 2014 I think I'll wait for 3.4 to land in a few days and from then on use py3 instead of 2.7 :)
- agumonkey 13y agoI forgot how close to the release date we were already. Joy.