( 2.31.New operators: 'eq', 'ne', 'last', '..' ) ?

Gerrit Holl gerrit.holl at pobox.com
Fri Jan 21 07:54:51 EST 2000


Stefan Schwarzer wrote on 948334133:
> Hi Evguenii
> 
> Evguenii Smogailov schrieb:
> > Well, just the same reason as for replacing '||', '&&' with 'or', 'and'.
> 
> I consider it a bad idea, to add synonyms for things that are
> already in the language. So _adding_ "greater" to the language (do you
> really find "greater" or just "gt" more readable as ">"?) is not
> the same as using "or" _instead_ of "||".

It would break code.

eq='aaa'

Wouldn't be possible anymore.

> Perhaps the ".." operator is something to consider (if it isn't
> incompatible with somethings else in the language), but most of
> the times "range" does it's job very well.

Unfortunately, not yet. It's quite hard to get a string which
would be a..k in Perl. Maybe a nice feature for range()?
>>> string.join(map(lambda i: chr(i), range(ord('a'), ord('k'))), '')
'abcdefghij'

Doesn't look very well, does it?

regards,
Gerrit.

-- 
Please correct any bad English you encounter in my email message!
-----BEGIN GEEK CODE BLOCK----- http://www.geekcode.com
Version: 3.12
GCS dpu s-:-- a14 C++++>$ UL++ P--- L+++ E--- W++ N o? K? w--- !O !M !V PS+ PE?
Y? PGP-- t- 5? X? R- tv- b+(++) DI D+ G++ !e !r !y
-----END GEEK CODE BLOCK-----




More information about the Python-list mailing list