PEP 308: ternary operator

phil hunt philh at cabalamat.uklinux.net
Fri Feb 21 20:00:26 EST 2003


On Fri, 21 Feb 2003 10:04:33 -0600, sismex01 at hebmex.com <sismex01 at hebmex.com> wrote:
>> From: philh at cabalamat.uklinux.net [mailto:philh at cabalamat.uklinux.net]
>> Sent: Friday, February 21, 2003 7:51 AM
>> 
>> On Thu, 20 Feb 2003 22:02:51 GMT, Raymond Hettinger 
>> >Also, the use of c?a:b in other languages is an important
>> >consideration so that skills are transferrable both to and
>> >from Python.   That syntax is used in enough other places
>> >to make it a valuable thing to know.
>> 
>> Does anyone have an estimate of the proportion of Python programmers
>> who know at least one C-syntax language? My guess is that at least
>> 66% of us do.
>
>And that proves.... what?  That it's justifiable to turn Python
>into a pseudo-C, pseudo-Perl kind of language just because at
>least 66% of us know them?

No, it suggests that we should we should make things easy for the 
majority of python programmers who also use other languages. Python 
will never become C or Perl, it will always be Python. However, 
Python shares lots of features with these langauges (and other 
langs) already, for example: use of "if" keyword to denote 
conditionals, use of symbols "0123456789" to denote numbers, use of 
"+" to denote addition, use of "=" to denote assignment, etc, etc.

Would you throw these features away, just because other language you 
don't like use them too?

>Python has a beautiful syntax, utterly wonderful to read in
>that it's just like skimming pseudo-code; I believe it would
>be terrible to lose that, just because it's easier to type
>
>     x = condition ? value : else_value

You don't like that syntax, fine. 

>instead of stopping what you're doing and thinking long and
>hard on what kind of syntax to use for __THIS__ particular
>language, a new construct which won't contaminate the
>current syntax with imported idioms that aren't truly part
>of the Python we know.  It should be an extension of Python,
>not an import from C/Perl/Java.

You are coming across as a language bigot. Python already has a 
*lot* of features in common with these languages.



-- 
|*|  Philip Hunt <philh at cabalamat.uklinux.net>   |*|
|*|  "Memes are a hoax; pass it on"              |*|





More information about the Python-list mailing list