Built-ins vs. modules

Paul Berkowitz berkowit at silcom.com
Tue Apr 15 01:31:43 EDT 2003


On 4/14/03 9:02 PM, in article
mailman.1050379428.20298.python-list at python.org, "Tim Peters"
<tim_one at email.msn.com> wrote:

> [Paul Berkowitz]
>> I see from the Python Library Reference (for 2.2) that a lot of
>> things which I thought required a module to be imported can also be
>> accessed without doing so:
>> 
>>>>> "boo".capitalize()   #built-in
>>     'Boo'
>>>>> import string
>>>>> string.capitalize("boo")
>>     'Boo'
>> 
>> Why import the string module if you can do the same things anyway?
> 
> Nostalgia; inertia; laziness; perverseness; whimsy; Luddism.
> 
>> The page of built in String Methods bears an uncanny resemblance to the
>> page on the string module. Is there a historical reason?
> 
> Yes:  string methods didn't exist before Python 1.6.  The string module has
> always been there.
> 
>> Are the built in type methods quite recent?
> 
> Python 1.6 was released in 2000.  Whether that's quite recent depends on
> whether you reckon in, say, geological time or computer time <wink>.
> 
> If you like investigating this kind of thing, see Misc/HISTORY and Misc/NEWS
> in your Python distribution (the latter gets prepended to the former as the
> centuries fly by).
> 
> 

Thank you - it's a privilege and pleasure to hear it from - I guess I'm not
supposed to say it. ;-) I've just been learning Python from "Learning
Python" which was written as v1.5-1.5.2 were prevalent, so naturally had
nothing about the built-in string methods.

I can see how much more there is to learn from the online Documentation,
which seems very thorough and clearly written. It's amazing how much has
been built up in such a short time.  There's a lot to learn. Thanks for the
History tips.

-- 
Paul Berkowitz







More information about the Python-list mailing list