
Python 3 breaks 'hello world' - illumen
http://renesd.blogspot.com/2007/09/python-3000-breaks-hello-world.html
======
jodrellblank
Where the article suggests it should be like:

    
    
      >>> help
      Type help() for interactive help [..].
    

This sort of (dis)functionality really gets on my nerves. Whenever I hit a
'nix program that does this:

    
    
      $somecmd -h
      Error. Use --help for help.
      $somecmd --help
      {help text}
    

or, in MacOS when I press CMD-C in the terminal instead of CTRL-C and it just
beeps at me, but does nothing...

Why don't you Just _DWIM_? Grr.

~~~
shadytrees
As it stands, help is a string.

If help does what you suggest, it becomes a keyword. Then it has to go into
the parser. Then somebody has to maintain that code. And document it. And the
backend code gets larger.

If it doesn't become a keyword, it becomes an exception to the rule. Which
means you'll have to deal with edge cases where the user tries to fudge with
the value of `help`. Does it act like a keyword? Should it have different
semantics? Should there be a separate category for it?

And then: What about `quit`? And `exit`?

The problem with DWIM is that doing what you mean in one case can create
doing-what-you-don't-mean in several other cases.

~~~
jodrellblank
As it stands, help isn't a string - if it was then typing help() would tell
you that strings aren't callable. It's a <class site._Helper>

So as well as printing that message, it could go into interactive help mode.
Since you're only going to want that at the console it could only happen at
the console, and since you typed "help" you probably want "help", that would
be ... helpful.

The real problem with DWIM is that nobody else has the same WIM. (But that's
not my problem, because it's all of you who are wrong. ;)

------
lazyant
The print() function and intentionally being backwards incompatible is the
first thing Guido (benevolent dictator) says in the release notes:
<http://docs.python.org/dev/3.0/whatsnew/3.0.html>

~~~
nuclear_eclipse
Note that TFA in question was written in September, using an alpha release.
There was no "What's New" for 3.0 yet...

------
babo
"What's new in P3K" mentions that print is function at the very top. For
existing code there is a nice conversion 2to3 which convert most of the
artifact like a charm. It worth to read some documentation before shouting.

------
tome
Well, the course notes should be rewritten to say:

print('Hello World')

Then it'll work in both Python 2 and 3.

~~~
nuclear_eclipse
Not quite. In Python 2.5:

    
    
        >>> print("hello")
        hello
        >>> print("hello","test")
        ('hello', 'test')
    

In Python 3:

    
    
        >>> print("hello")
        hello
        >>> print("hello","test")
        hello test

------
delackner
Hilariously if you read the comments, several confused people suggest that the
problem is just that it is "alpha" software, and of course such simple
problems will crop up. Right!

------
trezor
I'm not claiming this is the case, but would someone who has followed the
Python development care to enlighten the rest of the world about this?

With the statement that Python 3 "will break compatibility" and nobody
objecting is Python slowly turning PHPesque?

~~~
dazzawazza
I think everyone who uses Python seriously understands that the 'break', while
annoying, is necessary to create a better language.

No one really expects 2.6 to be abandoned any time soon (within the next 3
years or so) so there is plenty of time for projects you are dependant on to
move over to 3.0.

I think the difference between PHP and Python is that the Python community is
smaller and less antagonistic toward it's '(benevolent) dictator'.

I'm guessing a key difference is that most people (IMHO) that use python are
programmers and understand that a little pain now is preferable to a dead
language. A lot of PHP users aren't programmers. They are people who admin a
PHPBB and for them it was just a huge PITA researching what worked and didn't
between PHP4 and 5.

Of the 30 or so python packages that my work is dependant on none of them are
moving to 3.0 solely and most of them haven't finished moving to 2.6 yet. They
all support python 2.4+ I'm really not worried (I am aware that that statement
could bite me in the arse within the next year :).

~~~
mojuba
> a little pain now is preferable to a dead language

Who said Python is dying? It's been flourishing since it came out. It almost
killed Perl, almost became a de facto standard as a dynamic scripting
language, and so many people just fell in love with it.

What will actually kill Python is unjustified changes that break _all existing
code_. Or, let's view it as a different language that's simply doomed like
every other attempt to "fix" things that actually work.

It's that simple: fixing things that work is a waste of time.

~~~
dazzawazza
No one is saying that python is a dead language, as you say it's flourishing.
But a little pain IS preferable to a dead language.

While python works it doesn't mean it can't be improved. We are all free to
stick with 2.6 if we want to.

------
Eliezer
NOOOOOOOOOO

------
gaius
Step away from the keyboard, kid. You're too stupid to own a computer.

