Does Python need a '>>>' operator?

Alex Martelli aleax at aleax.it
Mon Apr 15 15:07:02 EDT 2002


David Eppstein wrote:

> Is it really appropriate to design a language so that only "typical"
> usages are simple, and everything else is made more difficult?

Yes, if the amount of "more difficulty" is reasonable, as it would be
here -- using built-in functions such as bitand, bitnot, and so on.

Languages must be small -- THAT is crucial.  Every aspect that is
hardwired into a language must fully pull its weight.  Python does
pretty well at this -- so the few imperfections stand out more.
`x` (backquotes) is another example, a silly duplication of repr.


> My most recent Python program (a testbed for some signal encoding
> schemes) made extensive use of both bit twiddling and simple generators.
> I'm very happy that Python was available for that purpose.


And me, I've done lot of combinatorics with Python -- so why couldn't
I have a postfix ! to indicate factorial?  Why did I have to write out (not
even a builtin, o heavens) fact(x) rather than the neat
         x!
???  Etc, etc.  Everyone and his cousin has their own peculiar uses, and
if the language tried to wire them all in it would be as unusable as your
worst nightmares.  The language should be lean and mean, with wired
support for _typical_ uses only, and libraries taking up the slack -- that
is *basically* Python today, btw, I'd only like it more so (in my dreams:-).

If we hadn't "wasted" `` as a duplication of repr, we could maybe use
them Haskellishly to make any function syntactically into an operator
and vice versa -- a `flep` b as a synonym for flep(a, b) -- but maybe
we don't need that syntax sugar all that badly:-).


Alex



Alex




More information about the Python-list mailing list