Live data from Hacker News

Python 3.3.0 released

python.org

81–90 of 119 posts

Re: Python 3.3.0 released

#81
post #74
post #58

Earlier quoted context omitted.

Impressive 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…

This 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/_deci... 2. http://docs.python.org/library/decimal.html#recipes

Thank you, out of interest on a appliction I work on every now and then showed a 50% improvement with the code as is, not heavy decimal at all, mostly int's though still a nice speedup.

Re: Python 3.3.0 released

#82
post #6

There 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 Py…

Have you looked at Pyramid? It's pretty awesome, really the ideal framework philosophy in my opinion (i.e., actually a framework instead of attempting to be a crappy domain-specific language/replacement standard library). It's also Python 3.x compatible and has been for several months (they replaced the one library they had been holding out for).

I gave Django a couple of truly honest tries, but I just couldn't bring myself to tolerate it. Pyramid is by far the best.

Re: Python 3.3.0 released

#83
post #42

I'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 langu…

Be careful what you wish for. The extreme alternative is Java, whose slavish obsession with backwards compatibility has effectively crippled the language. There's enough cruft in the standard library to keep newbies guessing for years, plus fundamental language design failures like type erasure and "beans". At some point you need to burn bridges in order to move forward. Doing this frequently destroys the community.…

This exact point is the basis for semantic versioning. Major version changes, e.g. 2.x.x to 3.x.x is expected to break backwards compatibility for the sake of progress. If you are happy with 2.x.x. stick with it, just don't expect any new features, just maintenance in the language and libraries built around it.

http://semver.org

Re: Python 3.3.0 released

#84
post #42

I'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 langu…

Be careful what you wish for. The extreme alternative is Java, whose slavish obsession with backwards compatibility has effectively crippled the language. There's enough cruft in the standard library to keep newbies guessing for years, plus fundamental language design failures like type erasure and "beans". At some point you need to burn bridges in order to move forward. Doing this frequently destroys the community.…

Well said.

Re: Python 3.3.0 released

#85
post #42

I'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 langu…

The problem is in the type system. Dynamic typing makes it difficult to ever change APIs, because a change could break anything that depends on them. pylint and other such tools help a little bit, but they can only do so much when the language doesn't support static typing.

Another Python feature that makes upgrades hard is monkeypatching, where one piece of code can inject arbitrary code into another piece of code. In many dynamic languages, this is often used to patch the behavior of core classes like String. I don't know how common this is in Python, but I've definitely seen it before. By erasing the distinction between interface and implementation, this makes it difficult to ever change them implementation of anything.

People say that writing more and more unit tests will solve these problems. But guess what? The more unit tests you have of an API, the more unit tests you have to change when that API changes. Unit tests are good and should be written in any language, but they are hardly a substitute for static typing.

The end result of all of this is that dynamically typed languages usually follow a trajectory where there's an initial burst of enthusiasm about some cool syntax, followed by a lot of code being written, and then a gradual descent into a compatibility tarpit, where nothing can be changed because of fear of breaking working code. Only additions can be made, and the language gradually grows uglier and uglier. Dynamically typed languages approximate Bourne shell more and more as time goes on-- a dozen slightly incompatible implementations, ancient quirks that bite hard on newcomers, and a resignation that this is the "best it gets."

Sometimes there's a burst of irrational hope towards the end of a language's lifetime. Perl 6 and Python 3 are good example of this. Developers go into their happy place and forget about the big bad compatibility bear that's been chasing them. But it's just a fantasy-- dynamic languages can't escape from the tarpit in the end, and nobody adopts the new thing.

Re: Python 3.3.0 released

#86
post #85
post #42

I'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 langu…

The problem is in the type system. Dynamic typing makes it difficult to ever change APIs, because a change could break anything that depends on them. pylint and other such tools help a little bit, but they can only do so much when the language doesn't support static typing. Another Python feature that makes upgrades hard is monkeypatching, where one piece of code can inject arbitrary code into another piece of code.…

> Another Python feature that makes upgrades hard is monkeypatching

You can't alter core classes (like str) in Python, and patching classes from other modules is considered a really weird, rare, bad practice.

Re: Python 3.3.0 released

#87
post #42

I'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 langu…

Is there a LINT for Python? It looks like there was a question about them on Stack Overflow, but it was closed. http://stackoverflow.com/questions/5611776/what-are-the-comp...

Aside from pylint which everyone has already mentioned, there's also pyflakes.

http://pypi.python.org/pypi/pyflakes

Re: Python 3.3.0 released

#88
post #77

Earlier quoted context omitted.

Here is my thought process... Regardless of how you feel about PHP, I've spent enough time with it that I can make it work and write good code, quickly. I do want to switch to another language at some point (I'll leave the reasoning for that out of this discussion). Why switch to Python 2.7 if it's going to be old in a year or two? Even if there isn't a huge difference between 2.7 and 3.x it sounds like it would be a…

There are ways to write Python2 code that will work when you make the switch to Python3. It _is_ a hassle, but it's quite doable. This may not convince you (and I perfectly understand why), but I think it's worth giving Python a shot even if you're fluent in another language.

Interesting, I'll look into it!

Re: Python 3.3.0 released

#90
post #6

There 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 Py…

> The scientific group is pretty much on board with Python 3. Ah .. NO! I can assure you that we are still stuck with Python 2.x (2.7 to be more precise). I am not too sure the others would have moved either.

There is movement, though - lots of the core stuff is already ported to Python 3, and once matplotlib 1.2 comes out (any day now), it's quite feasible to do serious work with Python 3.
Post reply on HN