osdir.com


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Old Man Yells At Cloud


On 2017-09-18 01:41, INADA Naoki wrote:
> > > That said, I'm neither here nor there when it comes to
> > > using print-as-a-statement vs print-as-a-function.  I like
> > > the consistency it brings to the language, but miss the
> > > simplicity that Py2 had for new users.  I'd almost want to
> > > get it back as a feature of the REPL, even if it wasn't
> > > part of the language itself,  
> >
> > Agreed on that point. At least bring it back in the REPL.
> > The removal of the finger friendly print statement has
> > caused more tension in this community than any feature of
> > such small stature should ever cause.
> >
> >  
> >>> x = 42
> >>> x  
> 42
> 
> x (1 keystroke) is easy to type than `print x` (7 keystrokes).
> While sometimes print(x) is different x (which uses repr), it's
> enough for most cases.
> So I can't agree it's REPL unfriendly.

Compare PDB for things that are PDB commands.

  (Pdb) list
  1  	j = 42
  2  	x = 31
  3  	import pdb; pdb.set_trace()
  4  ->	j = 15
  5  	x = 99
  [EOF]
  (Pdb) x
  31
  (Pdb) j
  *** The 'jump' command requires a line number
  (Pdb) print j
  *** SyntaxError: Missing parentheses in call to 'print'
  (Pdb) j 1
  > /home/tkc/test.py(1)<module>()
  -> j = 42
  (Pdb) j(2)
  *** The 'jump' command requires a line number

You (obstinate interpreter) know what I want, know what I mean, can't
possibly interpret it as some other command. Yet insist on pedantic
parens when you (interpreter) know full well the intended parsing,
accepting "j 1" to jump to line one instead of making me type "j(1)".

:grumble:

old-man-shaking-his-fist-at-the-sky'ly yers,

-tkc