News for hackers. Stuff that matters.
Re:What’s New in Python 3.0 by mojuba on Saturday June 21, 2008 @10:07AM (#223674)
print("fatal error", file=sys.stderr)

So, Python has become even less succinct for the sake of "consistency".

I think there is only one flawless, absolutely consistent machine, and that's Turing machine. The urge for consistency and simplification (I mean, if you are consistent in your aspiration for consistency) inevitably leads to reinventing the Turing machine in its purity. It's OK, except for some reason nobody wants to program for it.

Re:What’s New in Python 3.0 by j2d2 on Saturday June 21, 2008 @10:11AM (#223676)
print >>sys.stderr, "fatal error"

Considering this is this old version of what you copied, I don't think anything has been lost...

Re:What’s New in Python 3.0 by mojuba on Saturday June 21, 2008 @10:37AM (#223693)
I never liked that either, but the new version is physically longer and requires more typing. Moreover, I couldn't find any change in 3.0 that results in less typing. I might have missed something of course, but this announcement doesn't seem to be something to be excited about.

I was waiting, for example, lambdas to be allowed to have compound statements. Python, a nice language otherwise, could have been improved in many ways, none of which is found in 3.0.

Instead, the spirit of Python is coming closer and closer to Java: you are not supposed to do this, says Python to you, because it's a bad practice and can lead to errors.

I'm disappointed and I think I'd rather wait for another, more concise nobraces programming language.

Re:What’s New in Python 3.0 by jauco on Saturday June 21, 2008 @11:00AM (#223700)
from pep 3099:

    At one point lambda was slated for removal in Python 
    3000. Unfortunately no one was able to come up with a 
    better way of providing anonymous functions. And so 
    lambda is here to stay.

    But it is here to stay as-is. Adding support for 
    statements is a non-starter. It would require allowing 
    multi-line lambda expressions which would mean a  
    multi-line expression could suddenly exist. That would  
    allow for multi-line arguments to function calls, for  
    instance. That is just plain ugly.
Thread: "genexp syntax / lambda", http://mail.python.org/pipermail/python-3000/2006-April/0010...
Re:What’s New in Python 3.0 by mojuba on Saturday June 21, 2008 @11:47AM (#223717)
I understand there are syntactic obstacles, in fact I've been following these discussions, but... I'm very sorry, who cares?
Re:What’s New in Python 3.0 by j2d2 on Saturday June 21, 2008 @06:57PM (#223922)
> you are not supposed to do this, says Python to you, because it's a bad practice and can lead to errors.

Isn't that one of the main themes of Python? That you can expect another programmer to have solved the same problem almost the same way..? I figure this is how that happens.

Re:What’s New in Python 3.0 by mojuba on Saturday June 21, 2008 @07:07PM (#223928)
Curiously, this approach is usually welcomed in corporate environments. Java and C# are on the same shelf in this regard. It limits creativity by leaving no doors for new ways of doing things. Certain class of programmers just can't bear when they are told what's right and what's wrong in programming.
Re:What’s New in Python 3.0 by attack on Sunday June 22, 2008 @02:02AM (#224089)
Java, especially if you get into the OOP patterns fun, can present a million ways of doing things. Java is terrible about this.
Re:What’s New in Python 3.0 by anewaccountname on Saturday June 21, 2008 @11:14PM (#224018)
sys.stderr.write("fatal error\n")
Re:What’s New in Python 3.0 by simonw on Sunday June 22, 2008 @11:47AM (#224248)
You'll still be able to do that.
Re:What’s New in Python 3.0 by eru on Saturday June 21, 2008 @12:21PM (#223732)
Turing's machines are clunky. Do lambda calculus or grammars instead.
Re:What’s New in Python 3.0 by mojuba on Saturday June 21, 2008 @01:52PM (#223761)
Lambda calculus is beautiful, but modern computers are not lambda machines.
Re:What’s New in Python 3.0 by sdp on Saturday June 21, 2008 @03:12PM (#223800)
Is there a problem which can be solved in Lambda Calculus that cannot be solved in a Turing Machine?
Re:What’s New in Python 3.0 by mojuba on Saturday June 21, 2008 @03:38PM (#223814)
A Lambda machine can be implemented using a Turing machine, but not the other way around, which means, Lambda calculus is a subset. Correct me if I'm wrong.
Re:What’s New in Python 3.0 by staticshock on Saturday June 21, 2008 @03:58PM (#223822)
nope, they're turing equivalent. read up on the church-turing thesis.
Re:What’s New in Python 3.0 by eru on Monday June 23, 2008 @04:37AM (#224924)
They are lambda isomorph.
Re:What’s New in Python 3.0 by alexk on Saturday June 21, 2008 @11:04AM (#223702)
You can always consider print as low-level feature and wrap the whole thing in a fancy stream.

    class err_class:
        def __lshift__(self,other):
            print(other)
            return self

    err = err_class()
    err<<'fatal error:'<<'thats what happened'
Re:What’s New in Python 3.0 by mojuba on Saturday June 21, 2008 @11:13AM (#223707)
Of course I can do it, then why isn't it done already in the language?

Printing is something we do all the time in server applications, and that means, the printing facility in the language should be polished to death.

Re:What’s New in Python 3.0 by alexk on Saturday June 21, 2008 @11:31AM (#223711)
That's because really cool languages provide you with the power to build what you want, not the ton's of built-in fancy features.
Re:What’s New in Python 3.0 by mojuba on Saturday June 21, 2008 @11:45AM (#223716)
There is one advantage in having necessary stuff built into the language: others can understand your code quickly.

As for printing, it is so basic and simple, if implemented right of course, that I wouldn't call it "tons of fancy features".