6 ms·
Python 3.3.0 released
- castles 14y agoIt's time
- castles 14y agoThe `whole greater than the tally` feature set and performance improvements of this release, really has inched Python 3 to the point where I will want to start using it. With no basis beyond my own and other's like sentiment this still seems like an important milestone. Feel like many will move from inertiaville, at least building a weekend house in momentum town.
- masklinn 14y agoExciting. Python 3.3 is the first release of the Python 3 series which makes me go from "I'll have to come around to use Python 3" to "dammit, why isn't my codebase under Python 3 yet?". There's a bunch of neat stuff, minor and not so minor.
- reinhardt 14y agoAny specific examples that got you excited? I'm going through the new features list and I can't point to one that wowed me.
- masklinn 14y agoIt's more of an accumulation of things ending up making 3.3 way superior to 3.2 in the end. But, * The feature I like most is definitely generator delegation, it significantly improves more extensive uses of generators and iterators, and makes generator-as-coroutines a much more interesting proposition (before delegation, calling an other "coroutine" would be rather painful, now you essentially just have to tack a `yield from` in front, as you'd tack an `await` in C# 5.0) * The flexible string representation finally fixes narrow build's issues with astral planes, which is becoming rather important as astral planes include e.g. emoji, and it significantly reduces the possibility of bugs when working with astral planes (as there's no more behavioral difference between "narrow" and "wide" builds) * We'll have to see how they're used, but namespace support could be used to significantly cleanup of... well, namespaces (and multiple separate libraries living in the same namespace, without having to resort to PYTHONPATH hacks or setuptools tomfoolery) * A built-in, clean implementation of contexts/scopes (collections.ChainMap) I can already see plenty of use for. Same for signatures, there's high hijinks potential in that one. * The rest really is about a better experience all around: reduced memory, "unicode literals" (for Python 2 compat), ElementTree fixups, ...
- jlarocco 14y agoNot exciting, but virtualenv in core is nice.
- pkmays 14y agoNot mentioned among the major features: Windows builds have finally moved to Visual Studio 2010.
- facorreia 14y agoJust after Visual Studio 2012 was released?
- dnu 14y agoYes. Also keep in mind that Visual Studio 2010 is the last one which will work on Windows XP and Windows Vista.
- zanny 14y agoThe binaries are still backwards compatible, I hope wherever the python dev team is building the binaries they aren't still running 32 bit or vista.
- briancurtin 14y agoWe closed 3.3 for features months ago (June, maybe?) and it wasn't released. I would have liked to move to 2012 myself but the timing wasn't right. (I did the 2010 changes)
- csense 14y agoIt seems strange to me that they use Visual Studio rather than mingw/msys. Do any HN readers know why that is?
- eropple 14y agoI don't know why they don't, but I'd give serious thought to not supporting Windows at all if I had to use mingw/msys. And this is coming from somebody whose first order of business on a Windows machine is to install cygwin. The environment is just Not Friendly. Visual Studio is the vendor-suggested way of building C++ and it's free besides; there's not really a good reason not to use it.
- vph 14y agoThere are two significant factions in the Python community: the scientific group and the web-dev group. The scientific group is pretty much on board with Python 3. Perhaps due to unicode handling intricacies, that the web-dev group ain't exactly on board with Python 3 yet. But this needs to change and it takes leadership. Fortunately, bit and pieces such as webob are Python 3 compatible. And personally, I feel the Python web frameworks need a fresh redesign.
- srj55 14y agoPython 3 support in django is coming soon....!
- jaimebuelta 14y agoI think that Django support will probably speed up a lot the Python 3 adoption
- symbiotic 14y agoAs a PHP developer I've been waiting for the web-dev group to jump on board with Python 3 before I make the switch. I'm hoping it will be sooner rather than later.
- geekam 14y agoIs the difference between 2 and 3 so huge that it is not possible to make a jump?
- masklinn 14y agoIt's definitely possible (and not really hard), but I understand the mindset: if you're coming from an other platform, why bother with switching when you can wait a bit and just start with Python 3?
- slurgfest 14y agoBecause Python 2.7 is completely mature and production ready and also allows you to write code which runs pretty easily on Python 3. Then you are marking Python 2.7 as deprecated version at the time where before you would have been just getting started. Really this is down to whether you want to do something in Python now, or you want an excuse not to do it in Python for some time. It's not a bad excuse but it's also not a strong reason to wait.
- sigzero 14y agoVery awesome!
- sigzero 14y agoHere is what is new: http://docs.python.org/py3k/whatsnew/3.3.html http://docs.python.org/py3k/whatsnew/3.3.html
- endlessvoid94 14y ago> The Python interpreter becomes aware of a pvenv.cfg file whose existence signals the base of a virtual environment’s directory tree As someone who hated the .ini configuration for logging in python 2.5, this smells a bit.
- TazeTSchnitzel 14y agoAs someone who has used PHP and the infamous php.ini, this worries me too.
- sublimit 14y agoAnd not a single reason for me to stop using 2.7. It's been just bloat since 3.0.
- Shish2k 14y agoWhy use python at all? All languages have been just bloat since assembler :P
- masklinn 14y ago> It's been just bloat since 3.0. I can't make head or tail of that claim, what's the "bloat since 3.0"?
- nilliams 14y agoI'd tend to just ignore anyone that uses the word 'bloat' without backing their statement up with any substance/insight or perhaps acknowledgement that they may be wrong on some counts and are unlikely to understand the entire problem-space of said project to the extent they can justify deeming any significant portion of it unnecessary.
- masklinn 14y agoWell sure, but maybe he has genuine and interesting issues with Python 3, and maybe he just had a bad day, hasn't had his coffee yet or whatever and went with a quip rather than a complete comment. That happens.
- nilliams 14y agoSure, but it's lazy either way. Cries of 'bloat' without some supporting reasoning = alarms bells suggesting willful ignorance to me. Personally gets my goat a lot at work. It's so easy to allude to bloat, or (for example) some framework containing 'stuff you don't need' instead of doing your homework and making an effort to understand why that stuff exists.
- po 14y agoThe real advantage here is the release of Armin's u'' syntax addition proposal: http://www.python.org/dev/peps/pep-0414/ http://www.python.org/dev/peps/pep-0414/ In a nutshell, the 2.x version of declaring a unicode string is now valid (although redundant). From the PEP: In many cases, Python 2 offered two ways of doing things for historical reasons. For example, inequality could be tested with both != and <> and integer literals could be specified with an optional L suffix. Such redundancies have been eliminated in Python 3, which reduces the overall size of the language and improves consistency across developers. In the original Python 3 design (up to and including Python 3.2), the explicit prefix syntax for unicode literals was deemed to fall into this category, as it is completely unnecessary in Python 3. However, the difference between those other cases and unicode literals is that the unicode literal prefix is not redundant in Python 2 code: it is a programmatically significant distinction that needs to be preserved in some fashion to avoid losing information. This version of python should see more uptake by 2.x developers as it is now easier to port.
- slurgfest 14y agoAlthough it was a pain, it was manageable beforehand and in fact, if you need to support 3.1 or 3.2, you will still have to manage it a different way. Many of the features detailed in the release list are more helpful in general. 'yield from' is actually really good if you are using generator based coroutines, the wide/narrow build thing addresses a long-time pain point, it will be great if namespace packages are actually fixed by now, and adoption of virtualenv into the core is a big deal!
- aroberge 14y agoThis would have made it so much easier to create a version of Crunchy that could run transparently using either Python 2.x and 3.x. However, as much as I applaude this change, there are others new features in 3.3 that are just as important imo.
- TazeTSchnitzel 14y agoBuilt-in virtualenv? Finally!
- Zenst 14y ago"•A C implementation of the "decimal" module, with up to 80x speedup for decimal-heavy applications" That in itself is should make a few python gamers happy. Also some serious motivations for older version users, not all but more and more. Also many other interesting develepments others have highlighted already.
- deleted 14y ago[deleted]
- janzer 14y agoAnd 80x is apparently actually an understatement, at least for a few cases. Some numbers recently posted to python-dev show up to a 124X improvement: Precision: 9 decimal digits float: result: 3.1415926535897927 time: 0.113188s cdecimal: result: 3.14159265 time: 0.158313s decimal: result: 3.14159265 time: 18.671457s Precision: 19 decimal digits float: result: 3.1415926535897927 time: 0.112874s cdecimal: result: 3.141592653589793236 time: 0.348100s decimal: result: 3.141592653589793236 time: 43.241220s
- Zenst 14y agoImpressive stuff, though what struck me was the results, least accuracy wise and what rounding they using: Pi is 3.14159 26535 89793 238.... So I do wonder what rounding they are using, even truncating as I have (next digit 4 so good place to do that) then can see the last digit should at least be 8, worst case 7 and 6!! There again this may be a convention or result of the methord to calulate Pi. As for floats, well, for accuracy I'd go with cdecimal right there, though is it as accurate. I suspect it is the formular used that induces the minute error in results. http://en.wikipedia.org/wiki/Pi http://en.wikipedia.org/wiki/Pi #21 reference
- janzer 14y agoThis is from the decimal benchmarks included in the python source[1], in the recipe given in the decimal documentation[2] the precision is increased for the intermediate steps of the algorithm so it gives the correct end result. >>> pi() Decimal('3.141592653589793238') 1. http://hg.python.org/cpython/file/344d67063c8f/Modules/_decimal/tests/bench.py http://hg.python.org/cpython/file/344d67063c8f/Modules/_deci... 2. http://docs.python.org/library/decimal.html#recipes http://docs.python.org/library/decimal.html#recipes
- tisme 14y agoI've done quite a bit of python development. One of the things that really bugs me about python is how they keep breaking older stuff. Other languages have been much more careful about maintaining backwards compatibility and I think that is a big factor in the retention of users. Having to re-do any part of your code from one release of a language to another became a real deal breaker for me. For an interpreted language that problem is even worse because you don't know you have a problem until that bit of code gets hit.
- krosaen 14y agoIs this a 2x -> 3x gripe, or is there something specific in this release that breaks compatibility?
- TazeTSchnitzel 14y agoIf anything it should help, what with the u"" syntax being allowed now.
- tisme 14y agoI gave up before this release. edit: oh my, that's a lot of downvotes for answering a question.
- sbmassey 14y agoPython deliberately broke stuff in the 3.0 release, in order to get rid of some (minor) cruft, but other than that it is as backwards compatible as anything else. Complaining about backwards compatibility on the 3.3 release news item makes people think you have some specific issue in mind.
- deleted 14y ago[deleted]
- ams6110 14y agoIf you're talking about breakage between version 2 and 3 that is sort of what the major version number bump implies. I don't do much python work these days, but if stuff is (deliberately) breaking between minor releases I would agree that's not very nice.
- krosaen 14y agoI've always been uneasy about the increasing use of yield / generators in python these days, for instance, ndb in google app engine, twisted, etc. 'yield from' should make managing more complex uses of generators much easier - the question for me is, will this make me like widespread use of generators more, or will it make the use even more widespread, and still be kind of a pain to reason about, debug, etc.
- Ixiaus 14y agoProgrammer pr0n straight up. I can't wait for Pyramid 1.3.x to support Python 3.3!!!
- johnisme 14y agoCool!
- coolnow 14y agoWhich Python version would you recommend to someone just starting to learn the language? I know "Learn Python the Hard Way" focuses on Python 2.7, and "Learning Python (4th Edition)" focuses primarily on Python 3.
- magnusgraviti 14y agoAttending PyCon Ukraine 2011 it was very interesting to hear about Distutils2. But I see that in the end they are still not in Python3. But even without it I am going to try Python3 in my projects (hello Django 1.5, Tornado, Wheezy.web, jinja2 and a lot of others).