Built-ins vs. modules

Erik Max Francis max at alcyone.com
Tue Apr 15 00:38:26 EDT 2003


Paul Berkowitz wrote:

> Why import the string module if you can do the same things anyway? The
> page
> of built in String Methods bears an uncanny resemblance to the page on
> the
> string module. Is there a historical reason? Are the built in type
> methods
> quite recent?

The functions in the string module used to be the only way to do this. 
Starting with 2.0, string methods meant that for fiddling with strings,
you need not import the string module.

There are still a few things in the string module that are unavailable
via string methods; e.g., string.lowercase and the like.  Though there
was recent discussion about incorporating these into the string class in
some manner, which seems to be receive favorable responses (though I
don't know what its status is).

-- 
 Erik Max Francis / max at alcyone.com / http://www.alcyone.com/max/
 __ San Jose, CA, USA / 37 20 N 121 53 W / &tSftDotIotE
/  \ They have rights who dare defend them.
\__/ Roger Baldwin
    EmPy / http://www.alcyone.com/pyos/empy/
 A templating system for Python.




More information about the Python-list mailing list