Clashing cmp

Guido van Rossum guido at cnri.reston.va.us
Tue Sep 21 16:04:52 EDT 1999


"Fred L. Drake, Jr." <fdrake at acm.org> writes:

> Francois Pinard writes:

>  > There is a builtin function named `cmp', but there is also an importable
>  > module `cmp' in the standard library.  After a mere `import cmp' (I prefer
>  > to avoid `from cmp import SUCH-and-SUCH' if I may), I feel forced to write
>  > `__builtins__.cmp' to access the builtin function.

>  > This does not look very elegant to me.  Would not it be better if such
>  > elementary clashes were avoided, at least within the standard distribution?

> This tells me nobody has cared about the module until now.  If this
> is indeed the case, should it even remain "standard"?  I'd be happy to
> either give it a new name (suggestions?), or call it obsolete.
> Removing it is unlikely to break old code.

My suggestion would be to collect the functionality of cmp.py,
cmpcache.py, dircmp.py, and perhaps even dircache.py together in a new
filecmp module.  This looks like a reasonable amount of work; if we
can't find a volunteer to do it, we'll have to conclude that nobody
cares about any of these 4 modules and declare them all obsolete.

--Guido van Rossum (home page: http://www.python.org/~guido/)




More information about the Python-list mailing list