Re: Use 'python2' or 'python3', explicit is better than implicit (was: l = range(int(1E9)))

2015-04-30 Thread Rustom Mody
On Friday, May 1, 2015 at 4:50:45 AM UTC+5:30, Ben Finney wrote:
 Chris Angelico  writes:
 
  Very easily and simply: Python 3 and Python 2 will always install
  separately, and the only possible conflicts are over the python
  command in PATH and which program is associated with .py files.
 
 Using the 'python' command is now ambiguous, and with Python 2 slipping
 inexorably into the past, increasingly the 'python' command is the wrong
 choice for Python programs that we want to survive in the future.
 
 I am seeing a growing call, with which I agree, to recommend explicitly
 calling 'python2' or 'python3' as commands.

There was this recent exchange on the debian user list.
The OP asked a somewhat vague/generic question about recommendations for
programming books[0]

After some point when I put in
| 20 years ago I had written that C fries students' brains.
| If python had existed then I would have recommended it.[1]


Someone responded with:

| And yes, about the only *reasonable* way to understand Linux is to do
| write something which (ab)using syscalls. And that's something best done
| in C (maybe Perl).

| And please think of the children :) Teaching young ones something as
| volatile and ever-changing as Python (or, $DEITY forbid, Ruby) can be
| considered cruel and abusive :)  [2] [3]

From which I conclude that in the short term distinguishing python 2 from 3
may be convenient.
In the long term and in circles further away from those directly interested
in python... not clear (to me at least)

Coming to this question you rightly said:
 You seem to be asking for a way to stop a program doing exactly what
 it's written to do. I don't know what kind of answer you expect. 

which is to say if you explore pathology you will get pathological behavior.
What of it?

--
[0] https://lists.debian.org/debian-user/2015/04/msg00497.html
[1] https://lists.debian.org/debian-user/2015/04/msg00650.html
[2] https://lists.debian.org/debian-user/2015/04/msg00660.html
[3] https://lists.debian.org/debian-user/2015/04/msg00682.html
-- 
https://mail.python.org/mailman/listinfo/python-list


Use ‘python2’ or ‘python3’, explicit is better than implicit (was: l = range(int(1E9)))

2015-04-30 Thread Ben Finney
Chris Angelico ros...@gmail.com writes:

 Very easily and simply: Python 3 and Python 2 will always install
 separately, and the only possible conflicts are over the python
 command in PATH and which program is associated with .py files.

Using the ‘python’ command is now ambiguous, and with Python 2 slipping
inexorably into the past, increasingly the ‘python’ command is the wrong
choice for Python programs that we want to survive in the future.

I am seeing a growing call, with which I agree, to recommend explicitly
calling ‘python2’ or ‘python3’ as commands.

That includes when we type it for direct one-time invocation, or when we
set it as the command for automatic execution of a program (e.g. in the
“shebang” line of a program).

Use the command ‘python2’ or ‘python3’ to be explicit about which Python
version you intend to run. Legacy programs will continue to work, and
code targeting Python 3 will not accidentally get an incompatible Python
2 interpreter.

-- 
 \  “I don't want to live peacefully with difficult realities, and |
  `\ I see no virtue in savoring excuses for avoiding a search for |
_o__)real answers.” —Paul Z. Myers, 2009-09-12 |
Ben Finney

-- 
https://mail.python.org/mailman/listinfo/python-list