Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
version 2 to 3 changes
#1
as we all know, version 3 changed the print statement to a built in print() function.  i am curious why and also curious why not other statements.
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply
#2
PEP 3105.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply
#3
Here's the PEP: https://www.python.org/dev/peps/pep-3101/

I like the even newer python 3.6 version better.
Reply
#4
what PEP describes the changes to print() in 3.6?

when i was just getting started with python, one of the first things i created was a function to do printing.  it had the name pr() only because "print" was a reserved word.  but i got all the ability of having print as a function.  today, knowing more, if i still needed to do this, i'd add a few more features.  but i still don't see the reason to do this in the language itself, other than a module needed to be imported (this could have been added to the interpreter, to auto-import certain modules).  and, still, why not (also) some other things, like the del statement?

also, why not a transition phase, where both the function and the statement could coexist?
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply
#5
Quote:what PEP describes the changes to print() in 3.6?
https://www.python.org/dev/peps/pep-0498/

It's interesting, when I began (for the 2nd time) to use python, the only
complaint I had was with indentation.

I never think about it when writing code anymore, only (every day) when trying to get new users
to properly post code.

from the early 1980's until I retired, the main languages that I used were C and C++, with a few years
of forth (which I loved by the way, but it tended to be a write only language, like Perl).
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020