Re: Some set operators



Giovanni Bajo <noway@xxxxxxxxx> wrote:

> Alex Martelli <aleax@xxxxxxxxxxxxxxxx> wrote:
>
> > I still vaguely hope that in 3.0, where backwards incompatibilities
> > can be introduced, Python may shed some rarely used operators such as
> > these (for all types, of course).
>
> I hope there is no serious plan to drop them. There is nothing wrong in having
> such operators, and I wouldn't flag bit operations as "rarely used". They are
> very common when calling C-based API and other stuff. I know I use them very
> often. They have a clear and well-understood meaning, as they appear identical
> in other languages, including the widely-spread C and C++.

Well, C and C++ don't have unbounded-length integers, nor built-in sets,
so the equivalence is slightly iffy; and the precedence table of
operators in Python is not identical to that in C/C++. As for frequency
of use, that's easily measured: take a few big chunks of open-source
Python code, starting with the standard library (which does a lot of
"calling C-based API and other stuff") and widespread applications such
as mailman and spambayes, and see what gives.

But the crux of our disagreement lies with your assertion that there's
nothing wrong in having mind-boggling varieties and numbers of
operators, presumably based on the fact that C/C++ has almost as many.

I contend that having huge number of operators (and other built-ins)
goes against the grain of Python's simplicity, makes Python
substantially harder to teach, and presents no substantial advantages
when compared to the alternative of placing that functionality in a
built-in module (possibly together with other useful bit-oriented
functionality, such as counts of ones/zeros, location of first/last
one/zero bit, formatting into binary, octal and hexadecimal, etc).

As for "serious plans", it's been a while since I checked PEP 3000, but
I don't think it addresses this issue one way or another -- yet.


Alex
.



Relevant Pages

  • Re: About alternatives to Matlab
    ... Python and functional languages, but apropos of Ocaml, not these ... it has useful advanced functionality built in (linear ...
    (comp.lang.python)
  • Re: Is there a "Large Scale Python Software Design" ?
    ... I think that Python 2.3 capabilities already ... If you are aiming at a given fixed amount of functionality, ... the language level of the chosen implementation language, ... The design problem and the system integration may ...
    (comp.lang.python)
  • Re: Python becoming less Lisp-like
    ... >> I wonder if that is a valid reason to remove functionality from a ... > I already explained that the python lambda doesn't actually bring ... you know that "laws are forever." ... Every once in awhile I've gotten to vote on a local measure that would ...
    (comp.lang.lisp)
  • Re: Plugins / Modularity
    ... application in Python, and I've made a couple of ... functionality to the program, so to make it more extensible, and let ... package, and send these two objects to it's main callable. ... Here's a little snippet from a Python script that loads modules ...
    (comp.lang.python)
  • RE: perl to python
    ... If you like regex's then any missing awk/sed functionality could be a Python ... > Behalf Of Heather Coppersmith ... >> porting, and get better reuse. ...
    (comp.lang.python)