Naming Conventions

Alex Martelli aleaxit at yahoo.com
Thu Nov 9 21:03:17 CET 2000


"Johan Fredrik Øhman" <johan at essay.org> wrote in message
news:8uept8$q4m$1 at maud.ifi.uio.no...
> Hi,
>
> I've been programming with Python 2.0 for asbout a week,  and I like the
> language a lot !  But I just discovered somthing I really doesn't like:
> There is no consistency in the naming convention.   Most functions in
python
> is lowercase, thats ok,  but I discovered that the xml parser in the
library
> has functions that have capital letters, like 'Parse'

I'm not sure, but I suspect this may be deliberate, to avoid "accidental
polymorphism" with 'parse' functions in xml.sax (which are not
interchangeable with the 'Parse' im xml.parsers.expat's xmlparser
class).  It would be interesting to hear from somebody who does
know for sure, of course.


> Why isn't this standarised ?   I thought Python was a very strict
language.

It's reasonably strict, but not as much as several other languages.

It does not impose spacing around operators like Dylan does, for
example, nor does it enforce the common convention that classes
start in uppercase while functions start in lowercase.

Python is more about conventions than about mandatory enforcement.
Indeed, Pythonistas sometimes refer to certain other languages,
as a group, as "bondage & discipline" languages:-).


Alex






More information about the Python-list mailing list