end of print = lower productivity ?

Arnaud Delobelle arnodel at googlemail.com
Tue Nov 25 13:06:34 EST 2008


Tim Chase <python.list at tim.thechases.com> writes:

>>>>>> p = print
>>>>>> p("f")
>>> Voila, 4 keystrokes saved :-)
>>
>> When I write "print", it is both effortless and instantaneous : my
>> hands do not move, a wave goes through my fingers, it all happens in a
>> tenth of a second.
>>
>> Contrast this with what one has to go through to catch the SHIFT key,
>> and then the "(" : move the left hand, press SHIFT, move the right
>> hand, aim "(", press, miss, press again. Same thing at the end of the
>> function call.
>>
>> I know it sounds ridiculous, but it does *impair* my debugging
>> productivity. Taylor would agree.
>
> It's not so much "rediculous" as a failure of your editor to assist
> you.  In Vim (my editor-of-choice), I'd do something like
>
>   :iab print print()<left><bs>

Or if you had chosen Emacs for editing, you could add the following to
your .emacs.

(fset 'py3kprint
   [?p ?r ?i ?n ?t ?( ?) left])

(add-hook 'python-mode-hook 
	  '(lambda () (define-key python-mode-map "\C-cp" 'py3kprint)))

When in Python mode, it would bind C-c p to the same.

(Warning - I am not an emacs lisp pro!)

-- 
Arnaud



More information about the Python-list mailing list