[Python-Dev] Re: Missing arguments in RE functions

Michael Chermside mcherm at mcherm.com
Fri Sep 10 19:21:25 CEST 2004


Fredrik Lundh writes:
> the "I didn't prepare properly, didn't know what I was talking about,
> and didn't know what do answer when my students asked me a legitimate
> question" argument isn't a good reason to change the language.
>
> if you're doing Python training, make sure you know your
> Python.  I do,
> and I very seldom have problems explaining how things work.

Fredrik, a less hostile response would be appropriate here. No one
knows every detail of every API of any reasonably sized library
(like Python's). Students ask questions about the darndest things.
If you have never been stumped by a student's question then you're
not teaching the right people.

My opinion on the underlying question is this: We have two ways
of doing things: using compiled REs, and using the RE functions.
Our goal is to make Python's API be so simple and easy to understand
that people DON'T have to memorize every little detail -- it should
be "obvious". That is, in my opinion, the strongest reason in favor
of minimal APIs.

Right now, there are some things you can do with the RE functions
and a DIFFERENT set of things you can do with the compiled REs.
That's TWO sets of functionality to learn. If Noam's patch can
make the feature set of the RE functions the SAME as the feature
set of the compiled REs, then there's only ONE set of features to
memorize. On the whole, there are MORE indiviual "pieces" to the
API but because of orthogonality the API as a whole is simpler.
Therefore in this case I favor using Noam's patch.

My next-favorite alternative would actually be to remove the
RE functions so there's "only one way to do it". But the functions
are conceptually simpler (as Noam showed, the docs describe the
functions then say the compiled REs work "just the same"), and
they've been in place for years... removing them is not an option.

-- Michael Chermside



More information about the Python-Dev mailing list