[Python-Dev] Re: Rationale behind removing kwdict from keyword.py?

Michael Hudson mwh at python.net
Thu Jul 29 12:19:19 CEST 2004


Fernando Perez <fperez528 at yahoo.com> writes:

> Tim Peters wrote:
>
>> Note that it's very common in older modules (which keyword.py is) to
>> define the newer __all__ rather than risk breaking code by massive
>> renaming of variables to stick an underscore in front of them.
>
> Fair enough.  For a long time I'd gotten used to assuming that the lack of a
> leading _ was a safe sign of 'publicness' (that's probably not a word :), and
> didn't really rely too much on __all__.  Lesson learned... (I wouldn't be
> surprised to find I'm not the only one with this bad habit)

Well, not entirely your fault, I'd say.  If kwdict wasn't part of the
public API of the module, it was arguably a bug in all previous
versions of the module that it *didn't* start with an underscore.

Fortunately, this is shallow and easy to mend, but small random
breakages like still to be avoided.

Cheers,
mwh

-- 
  well, take it from an old hand: the only reason it would be easier
  to program in C is that you can't easily express complex problems
  in C, so you don't.                   -- Erik Naggum, comp.lang.lisp


More information about the Python-Dev mailing list