Why Turn "Print" into "Print()"????

Discussion in 'Python' started by Prisoner at War, May 26, 2008.

  1. Hi, your friendly neighborhood n00b here, just wondering why on earth
    the Py3K folks want to mess with a simple thing like the "print"
    "command" (is that what it's called, a command?), turning it into
    "print()"...I mean, what's the point, exactly?? To look like a more
    "traditional" computer-language format?

    And what's with not supporting the so-called softspace "feature" of
    the current "print" command, where a space after a comma, like

    >>>print "A\n", "B"


    outputs

    >>>A\nB\n


    but with Py3K it will be

    >>>print("A\n", "B")


    returning

    >>>A\n B\n


    ????

    I was all excited to start learning the language, when suddenly I find
    out that a new version is slated for release late summer/early fall
    this year -- a new version which is not only not backwards-compatible
    with previous versions in many important ways, but even when it comes
    to a little thing like the "print" command!!

    What's up with that??
     
    Prisoner at War, May 26, 2008
    #1
    1. Advertising

  2. Prisoner at War

    Guest

    On May 25, 8:26 pm, Prisoner at War <> wrote:
    > Hi, your friendly neighborhood n00b here, just wondering why on earth
    > the Py3K folks want to mess with a simple thing like the "print"
    > "command" (is that what it's called, a command?), turning it into
    > "print()"...I mean, what's the point, exactly?? To look like a more
    > "traditional" computer-language format?
    >
    > And what's with not supporting the so-called softspace "feature" of
    > the current "print" command, where a space after a comma, like
    >
    > >>>print "A\n", "B"

    >
    > outputs
    >
    > >>>A\nB\n

    >
    > but with Py3K it will be
    >
    > >>>print("A\n", "B")

    >
    > returning
    >
    > >>>A\n B\n

    >
    > ????
    >
    > I was all excited to start learning the language, when suddenly I find
    > out that a new version is slated for release late summer/early fall
    > this year -- a new version which is not only not backwards-compatible
    > with previous versions in many important ways, but even when it comes
    > to a little thing like the "print" command!!
    >
    > What's up with that??


    See http://www.python.org/dev/peps/pep-3105/
    That should answer all your questions.
     
    , May 26, 2008
    #2
    1. Advertising

  3. On May 25, 8:37 pm, "" <> wrote:
    >
    >
    > See http://www.python.org/dev/peps/pep-3105/
    > That should answer all your questions.


    Hey, thanks, I missed that one!

    Not that I understand the rationale given (iman00b), but oh well, so
    it looks like a real function now.

    Might you have any idea, BTW, whether the upcoming "Head First
    Programming" from O'Reilly, coming in August, will cover Python 3??
    Unlikely, right? Unless maybe if that guy Vern Ceder (the author) is
    active in the Python development community??

    I'd already pre-ordered the book...but it makes no sense to get a book
    on "old" Python 2.x if it's just going to get deprecated in like a
    year or two! Then again, current Python programs would still work,
    right? I mean, once it's been done up as an executable...PySol or
    something should still work, right? (Sorry, iman00b, I don't really
    know how this stuff works....)
     
    Prisoner at War, May 26, 2008
    #3
  4. En Mon, 26 May 2008 02:06:02 -0300, Prisoner at War <> escribió:

    > Might you have any idea, BTW, whether the upcoming "Head First
    > Programming" from O'Reilly, coming in August, will cover Python 3??
    > Unlikely, right? Unless maybe if that guy Vern Ceder (the author) is
    > active in the Python development community??
    >
    > I'd already pre-ordered the book...but it makes no sense to get a book
    > on "old" Python 2.x if it's just going to get deprecated in like a
    > year or two! Then again, current Python programs would still work,
    > right? I mean, once it's been done up as an executable...PySol or
    > something should still work, right? (Sorry, iman00b, I don't really
    > know how this stuff works....)


    The differences aren't so fundamental or important: it's not an entirely new language, just some ugly old things are being removed or changed in incompatible ways (at *some* time it was supposed to happen - but could not happen on the 2.x series which has to remain backwards compatible)
    Also, Python 3.0 will be released simultaneously with 2.6, and there will be other 2.x releases. Python 2 won't magically disappear from Earth, I don't think Linux distros will come with Python 3.0 by default anytime soon (perhaps not before 3.1).
    So learning Python with a book targeted to 2.5 isn't a waste of time - not at all.
    (This subject has already been discussed several times in this group.)

    --
    Gabriel Genellina
     
    Gabriel Genellina, May 26, 2008
    #4
  5. On May 26, 1:37 am, "Gabriel Genellina" <>
    wrote:
    >
    >
    > The differences aren't so fundamental or important: it's not an entirely new language, just some ugly old things are being removed or changed in incompatible ways (at *some* time it was supposed to happen - but could not happen on the 2.x series which has to remain backwards compatible)
    > Also, Python 3.0 will be released simultaneously with 2.6, and there will be other 2.x releases. Python 2 won't magically disappear from Earth, I don't think Linux distros will come with Python 3.0 by default anytime soon (perhaps not before 3.1).


    But I'd read that Python 3 is very different in many important ways.
    I read it right there on the Py3K site! I can't make sense of how,
    why, even what, exactly, but that's not a misimpression on my part, I
    certain nonetheless...it's not just cosmetic changes but important
    ones pertaining to a sort of "linguistic logic" I gather....

    > So learning Python with a book targeted to 2.5 isn't a waste of time - not at all.


    Well, I will be learning Python from the excellent materials available
    online, to be sure, but a book that I spend money for, well, I have
    "higher standards" for it, you know, one of which is that it doesn't
    get superseded so soon!

    > (This subject has already been discussed several times in this group.)


    Oops, sorry! Just thinking aloud a logical follow-up question....

    > --
    > Gabriel Genellina
     
    Prisoner at War, May 26, 2008
    #5
  6. Prisoner at War wrote:
    > On May 26, 1:37 am, "Gabriel Genellina" <> wrote:
    >>
    >>
    >> The differences aren't so fundamental or important: it's not an entirely
    >> new language, just some ugly old things are being removed or changed in
    >> incompatible ways (at *some* time it was supposed to happen - but could
    >> not happen on the 2.x series which has to remain backwards compatible)
    >> Also, Python 3.0 will be released simultaneously with 2.6, and there will
    >> be other 2.x releases. Python 2 won't magically disappear from Earth, I
    >> don't think Linux distros will come with Python 3.0 by default anytime
    >> soon (perhaps not before 3.1).

    >
    > But I'd read that Python 3 is very different in many important ways.


    Yes, and that is the reason it is version 3.x instead of another 2.x. Moving
    to version 3 signals that some changes were done that are _not_ backward
    compatible and not even intended to.

    > I read it right there on the Py3K site! I can't make sense of how,
    > why, even what, exactly, but that's not a misimpression on my part,
    > I certain nonetheless...it's not just cosmetic changes but important
    > ones pertaining to a sort of "linguistic logic" I gather....


    Well, cosmetic or important is always in the eye of the beholder. I
    personally would say that they are important cosmetic changes. You don't
    get any new features or a more Touring-complete language suddenly, but it
    will be much more consistent because it doesn't have to maintain wrong
    decisions of the past, like making 'print' a separate statement when a
    function would do.

    >> So learning Python with a book targeted to 2.5 isn't a waste of time -
    >> not at all.

    >
    > Well, I will be learning Python from the excellent materials available
    > online, to be sure, but a book that I spend money for, well, I have
    > "higher standards" for it, you know, one of which is that it doesn't
    > get superseded so soon!


    As already pointed out, Python 2 will not suddenly cease to exist and
    knowledge about it won't suddenly be worthless either. I guess it will take
    a few years until the use of Python 3 supercedes that of Python 2.

    Uli

    --
    Sator Laser GmbH
    Geschäftsführer: Thorsten Föcking, Amtsgericht Hamburg HR B62 932
     
    Ulrich Eckhardt, May 26, 2008
    #6
  7. Prisoner at War

    alex23 Guest

    On May 26, 7:21 pm, Prisoner at War <> wrote:
    > But I'd read that Python 3 is very different in many important ways.
    > I read it right there on the Py3K site! I can't make sense of how,
    > why, even what, exactly, but that's not a misimpression on my part, I
    > certain nonetheless...it's not just cosmetic changes but important
    > ones pertaining to a sort of "linguistic logic" I gather....


    Well, let's see what Guido says about the issue:

    Q. I want to learn Python. Should I learn Python 2.6 or Python 3.0?

    A. Definitely learn Python 2.x (the latest version out is 2.5). I
    expect it'll be two years before you'll need to learn Python 3.0, and
    the differences aren't that great from a beginner's perspective: most
    of what you'll learn about 2.x will still hold about 3.0.

    (from http://www.artima.com/weblogs/viewpost.jsp?thread=211200)
     
    alex23, May 26, 2008
    #7
  8. Prisoner at War

    Terry Reedy Guest

    "alex23" <> wrote in message
    news:...
    | On May 26, 7:21 pm, Prisoner at War <> wrote:
    | > But I'd read that Python 3 is very different in many important ways.
    | > I read it right there on the Py3K site! I can't make sense of how,
    | > why, even what, exactly, but that's not a misimpression on my part, I
    | > certain nonetheless...it's not just cosmetic changes but important
    | > ones pertaining to a sort of "linguistic logic" I gather....

    One important different for beginners is the elimination of old ways that
    no longer need be learned. Another is that a few inconsistencies have be
    ironed out.

    | Well, let's see what Guido says about the issue:
    |
    | Q. I want to learn Python. Should I learn Python 2.6 or Python 3.0?
    |
    | A. Definitely learn Python 2.x (the latest version out is 2.5). I
    | expect it'll be two years before you'll need to learn Python 3.0, and
    | the differences aren't that great from a beginner's perspective: most
    | of what you'll learn about 2.x will still hold about 3.0.
    |
    | (from http://www.artima.com/weblogs/viewpost.jsp?thread=211200)

    My personal view is a little different. Learn 3.0 unless you have a reason
    to learn 2.x (and there are many possible ;-). Guido wrote the above
    nearly a year ago, before either existed to be learned. As it turned out,
    a decision was made to backport most of the new features of 3.0 into 2.6 to
    ease the transition. Consequently, 2.6 is in some sense the union of 2.5
    and 3.0, so that there is more to learn. This is not a problem for Guido,
    but I can easily imagine that the extra duplication of function might be
    for a new learner, let alone someone like me who liked Python for its
    relative smallness. I personally have no perceived need and hence no plans
    to ever touch 2.6. So, depending on circumstances, again, I might suggest
    2.5 instead of 2.6.

    tjr
     
    Terry Reedy, May 27, 2008
    #8
  9. print a statement

    let's make it import() if() (C freaks) except() else() what else()

    It was just convenient to not have to write those parenthesis

    I agree with the OP, of course if you wrote my post after I began look
    into this

    Parentheses for the people..

    I mean, it's not that.... making it a function?

    Well I'd have suggested, make a function and call it write()

    The name print is a misnormer any case

    So it keeps a misleading name and make it a function, thinks it is a
    cleanup

    Just Add a write() builtin function so can we use that if we want a
    function

    but keep the print statement, the import statement, the if statement,
    the for statement...

    Dont make they functions. Or is this just to throw us out?

    S...


    On May 26, 12:20 pm, Ulrich Eckhardt <> wrote:
    > Prisoner at War wrote:
    > > On May 26, 1:37 am, "Gabriel Genellina" <> wrote:

    >
    > >> The differences aren't so fundamental or important: it's not an entirely
    > >> new language, just some ugly old things are being removed or changed in
    > >> incompatible ways (at *some* time it was supposed to happen - but could
    > >> not happen on the 2.x series which has to remain backwards compatible)
    > >> Also, Python 3.0 will be released simultaneously with 2.6, and there will
    > >> be other 2.x releases. Python 2 won't magically disappear from Earth, I
    > >> don't think Linux distros will come with Python 3.0 by default anytime
    > >> soon (perhaps not before 3.1).

    >
    > > But I'd read that Python 3 is very different in many important ways.

    >
    > Yes, and that is the reason it is version 3.x instead of another 2.x. Moving
    > to version 3 signals that some changes were done that are _not_ backward
    > compatible and not even intended to.
    >
    > > I read it right there on the Py3K site! I can't make sense of how,
    > > why, even what, exactly, but that's not a misimpression on my part,
    > > I certain nonetheless...it's not just cosmetic changes but important
    > > ones pertaining to a sort of "linguistic logic" I gather....

    >
    > Well, cosmetic or important is always in the eye of the beholder. I
    > personally would say that they are important cosmetic changes. You don't
    > get any new features or a more Touring-complete language suddenly, but it
    > will be much more consistent because it doesn't have to maintain wrong
    > decisions of the past, like making 'print' a separate statement when a
    > function would do.
    >
    > >> So learning Python with a book targeted to 2.5 isn't a waste of time -
    > >> not at all.

    >
    > > Well, I will be learning Python from the excellent materials available
    > > online, to be sure, but a book that I spend money for, well, I have
    > > "higher standards" for it, you know, one of which is that it doesn't
    > > get superseded so soon!

    >
    > As already pointed out, Python 2 will not suddenly cease to exist and
    > knowledge about it won't suddenly be worthless either. I guess it will take
    > a few years until the use of Python 3 supercedes that of Python 2.
    >
    > Uli
    >
    > --
    > Sator Laser GmbH
    > Geschäftsführer: Thorsten Föcking, Amtsgericht Hamburg HR B62 932
     
    Sverker Nilsson, May 27, 2008
    #9
  10. Prisoner at War

    alex23 Guest

    On May 27, 5:47 pm, Sverker Nilsson <> wrote:
    > Dont make they functions. Or is this just to throw us out?


    Have you even bothered to read the reasoning for this change since the
    last time you got your knickers twisted over it?

    http://www.python.org/dev/peps/pep-3105/#rationale

    I don't see "piss everyone off" listed there anywhere.

    Personally, I believe if you're writing code of any serious length,
    you generally shouldn't be using 'print' anyway, using the logging
    module allows for a lot more flexibility.

    If you're bothered by having to type the parentheses while in the
    interpreter, try using IPython with it's autocall mode turned on.
     
    alex23, May 27, 2008
    #10
  11. I had bothered. Volunterly that is too. Becausa I care.

    Should we piss of about py3k? It's a debate.

    Guiod wrote also something he got from Ruby: "Open source need to
    change or die"

    If I recall correctly. I cant get too bothered for I get tired too.

    But change is not == progress.

    Sometimes it is like in the 70s here when we had even worse economy
    "Well, at least it gives some work opportunities"

    Think about it. It is Less work that is the ideal, the thing to strive
    for
    Not More work - it may look to give more money but it is really not
    economic

    So is it this the way ? No ? It ain't broken so lets brake it

    S


    On May 27, 10:15 am, alex23 <> wrote:
    > On May 27, 5:47 pm, Sverker Nilsson <> wrote:
    >
    > > Dont make they functions. Or is this just to throw us out?

    >
    > Have you even bothered to read the reasoning for this change since the
    > last time you got your knickers twisted over it?
    >
    > http://www.python.org/dev/peps/pep-3105/#rationale
    >
    > I don't see "piss everyone off" listed there anywhere.
    >
    > Personally, I believe if you're writing code of any serious length,
    > you generally shouldn't be using 'print' anyway, using the logging
    > module allows for a lot more flexibility.
    >
    > If you're bothered by having to type the parentheses while in the
    > interpreter, try using IPython with it's autocall mode turned on.
     
    Sverker Nilsson, May 27, 2008
    #11
  12. Prisoner at War

    Paddy Guest

    On May 27, 12:14 pm, Sverker Nilsson <> wrote:
    > I had bothered. Volunterly that is too. Becausa I care.
    >
    > Should we piss of about py3k? It's a debate.
    >

    I suggest you try and drum up some support for your
    position. If you don't get much, then maybe you should
    reconsider your stance? And if you do, then you as a group
    might find a more effective way to persuade others to
    change.

    - Paddy.
     
    Paddy, May 27, 2008
    #12
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mr. SweatyFinger
    Replies:
    2
    Views:
    2,137
    Smokey Grindel
    Dec 2, 2006
  2. edcwealth1
    Replies:
    0
    Views:
    243
    edcwealth1
    Jun 22, 2007
  3. coreyger
    Replies:
    0
    Views:
    256
    coreyger
    Jun 22, 2007
  4. coreyger
    Replies:
    0
    Views:
    239
    coreyger
    Jun 22, 2007
  5. Eric Osman
    Replies:
    2
    Views:
    426
    Eric Osman
    Apr 14, 2004
Loading...

Share This Page