Re: Make the "python" command resemble the standard Python interpreter

Doug Evans
2012-01-26T17:43:34Z

On Tue, Jan 24, 2012 at 9:30 AM, Tom Tromey <tromey@redhat.com> wrote:
>>>>>> "Doug" == Doug Evans <dje@google.com> writes:
>
> Doug> I'm not that comfortable with having the python command having such
> Doug> varying behaviours (especially based on the value of from_tty).
>
> What bad effect do you think it will cause?

[for example]
Suppose I want to cut-n-paste some lines from a script into my session?
Maybe as a quick hack or maybe to test something out or whatever.

With this change I can't do that for something that contains:

python
foo
end

As I say, having "python" invoke the python repl *is* the more
intuitive thing to do,
so add a new command, python-foo, that retains/provides the old
"python ... end" behaviour and I'm ok.
[IWBN to also deprecate and eventually remove support for "python ...
end", but that's a teensy bit harder, 1/2 :-).]

OTOH, I don't mind just adding "python-foo" to invoke the python repl.
If someone doesn't want to type all that s/he can always do "alias
pyfoo = python-foo" (or whatever).
We could even provide our own alias (if we could come up with
something better than "python" :-)).