soundex (revisited)

Emile van Sebille emile at fenx.com
Sun Dec 24 13:54:54 EST 2000


"Daniel Klein" <DanielK at aracnet.com> wrote in message
news:Var16.263$LU6.109277 at typhoon.aracnet.com...
> After seeing the post from several days ago on soundex, I
gave it whirl to
> see if I could come up with something different (and
possibly better),
> following the rules laid down by Knuth:
>
<snip>
> One question: how is it that this understands the
'upper()' function without
> explicitly importing the 'string' module?
>
> Dan:
>
>


In 2.0, strings now have methods:


Python 2.0 (#8, Oct 16 2000, 17:27:58) [MSC 32 bit (Intel)]
on win32
Type "copyright", "credits" or "license" for more
information.
IDLE 0.6 -- press F1 for help
>>> print dir("")
['capitalize', 'center', 'count', 'encode', 'endswith',
'expandtabs', 'find', 'index', 'isalnum', 'isalpha',
'isdigit', 'islower', 'isspace', 'istitle', 'isupper',
'join', 'ljust', 'lower', 'lstrip', 'replace', 'rfind',
'rindex', 'rjust', 'rstrip', 'split', 'splitlines',
'startswith', 'strip', 'swapcase', 'title', 'translate',
'upper']
>>>



--

Emile van Sebille
emile at fenx.com
-------------------






More information about the Python-list mailing list