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

Andrew Csillag drew.csillag at starmedia.net
Wed Jan 19 21:20:02 EST 2000


Evguenii Smogailov wrote:
> 
> On Wed, 19 Jan 2000, Fredrik Lundh wrote:
> > > Generally for improving readability,
> > > (and Perl compatibility).
> >
> > oh, come on.  since when is "Perl compatibility" a
> > guiding principle for Python's design?
> 
> Well, i mean all that 1 million Perl programmers that would like to learn
> Python someday:)

Just because I know lisp doesn't mean I can't learn python.  I don't
find it a defect that python doesn't support prefix notation like lisp
does (wouldn't it be awful if it did?  Yeesh...).  Python doesn't have
to be Perl for Perl programmers to be able to learn it.  I bet there are
a bunch of Perl programmers that even know Java.

> 
> But the MAIN reason is READABILITY
> 

You're saying that Perl is readable? HAHAHAHA... Oh, you were serious...
Ok, 1 eq 2 is easier to read that 1==2?  Hmmmm... I think not.

Cluttering Python's syntax with additional operators like eq, etc. where
operators like == already exist is just a bad idea.  If you really want
it, create a module perl.py that has the following:

def eq(a, b):
    return a==b
def gt(a, b):
    return a > b
..etc..
And then, no one will be able to read your code.

-- 
print(lambda(q,p):'pmt:$%0.2f'%(q*p/(p-1)))((lambda(a,r,n),t:(a*r/
t,pow(1+r/t,n*12)))(map(input,('amt:','%rate:','years:')),1200.0))




More information about the Python-list mailing list