map/filter/reduce/lambda opinions and background unscientific mini-survey
twic at urchin.earth.li
Wed Jul 6 15:28:55 CEST 2005
On Wed, 5 Jul 2005, George Sakkis wrote:
> "Steven D'Aprano" <steve at REMOVETHIScyber.com.au> wrote:
>> On Tue, 05 Jul 2005 09:46:41 -0500, Terry Hancock wrote:
>> Def would be short for ... defend? defile? defer? defame? default? deflect?
>> There's always *something* to learn. Why def instead of define? Because
>> "easy to write" beats "instantly obvious to a beginner", if the word is
>> used all the time and is easy to memorize.
> Still it's hard to explain why four specific python keywords - def,
> del, exec and elif - were chosen to be abbreviated, while all the rest
> are full words (http://docs.python.org/ref/keywords.html). "Ease of
> typing" is a joke for an excuse;
For exec and probably del, yes, but def and elif are two of the most
frequently used keywords in the language, so i think it's reasonable to
keep them short.
> So, who would object the full-word versions for python 3K ?
> def -> define
I'd keep this short - it's one of the most commonly-used keywords. It's
particularly commonly used if you break your programs down into lots of
little functions; since this is, IMHO, something we want to encourage
people to do, we should strive to minimise boilerplate.
> del -> delete
How about just getting rid of del? Removal from collections could be done
with a method call, and i'm not convinced that deleting variables is
something we really need to be able to do (most other languages manage
> exec -> execute
This should be a function somewhere, maybe a builtin, maybe not - it
absolutely should not be a keyword. What that function should be called, i
> elif -> else if
I'm not sure about splitting it into two words; there's currently a very
simple relationship between flow control keywords, meanings, and blocks of
code, which would be broken if we moved to using "else if". I don't know
that this relationship is actually important, though.
Don't believe his lies.
More information about the Python-list