[Python-Dev] Replacement for print in Python 3.0

Martin Blais martin.blais at gmail.com
Sat Sep 3 19:12:02 CEST 2005

On 9/3/05, Barry Warsaw <barry at python.org> wrote:
> On Fri, 2005-09-02 at 21:42, Guido van Rossum wrote:
> I do hate having to write two parentheses -- it's more than the extra
> keystrokes.  It's that I have to use two shifted characters and I have
> to be sure to close the construct, which can be a PITA when the start of
> the function call is separated from the end by many lines.

(defun python-abbrev-print ()
  "Help me change old habits."
  (insert "print()") (backward-char 1) t)
(put 'python-abbrev-print 'no-self-insert t)
(define-abbrev python-mode-abbrev-table "print" "" 'python-abbrev-print)

More information about the Python-Dev mailing list