String functions deprication
Paul Watson
pwatson at redlinepy.com
Tue Aug 16 17:25:47 EDT 2005
Sorry, the previous post was based on Python 2.1. That is probably not
of much interest. How about 2.4.1?
Python 2.4.1 (#1, Jul 19 2005, 14:16:43)
[GCC 4.0.0 20050519 (Red Hat 4.0.0-8)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import string
>>> dir(string)
['Template', '_TemplateMetaclass', '__builtins__', '__doc__',
'__file__', '__name__', '_float', '_idmap', '_idmapL', '_int', '_long',
'_multimap', '_re', 'ascii_letters', 'ascii_lowercase',
'ascii_uppercase', 'atof', 'atof_error', 'atoi', 'atoi_error', 'atol',
'atol_error', 'capitalize', 'capwords', 'center', 'count', 'digits',
'expandtabs', 'find', 'hexdigits', 'index', 'index_error', 'join',
'joinfields', 'letters', 'ljust', 'lower', 'lowercase', 'lstrip',
'maketrans', 'octdigits', 'printable', 'punctuation', 'replace',
'rfind', 'rindex', 'rjust', 'rsplit', 'rstrip', 'split', 'splitfields',
'strip', 'swapcase', 'translate', 'upper', 'uppercase', 'whitespace',
'zfill']
>>> dir("")
['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
'__eq__', '__ge__', '__getattribute__', '__getitem__', '__getnewargs__',
'__getslice__', '__gt__', '__hash__', '__init__', '__le__', '__len__',
'__lt__', '__mod__', '__mul__', '__ne__', '__new__', '__reduce__',
'__reduce_ex__', '__repr__', '__rmod__', '__rmul__', '__setattr__',
'__str__', 'capitalize', 'center', 'count', 'decode', 'encode',
'endswith', 'expandtabs', 'find', 'index', 'isalnum', 'isalpha',
'isdigit', 'islower', 'isspace', 'istitle', 'isupper', 'join', 'ljust',
'lower', 'lstrip', 'replace', 'rfind', 'rindex', 'rjust', 'rsplit',
'rstrip', 'split', 'splitlines', 'startswith', 'strip', 'swapcase',
'title', 'translate', 'upper', 'zfill']
>>> for m in dir(string):
... if m not in dir(""):
... print m
...
Template
_TemplateMetaclass
__builtins__
__file__
__name__
_float
_idmap
_idmapL
_int
_long
_multimap
_re
ascii_letters
ascii_lowercase
ascii_uppercase
atof
atof_error
atoi
atoi_error
atol
atol_error
capwords
digits
hexdigits
index_error
joinfields
letters
lowercase
maketrans
octdigits
printable
punctuation
splitfields
uppercase
whitespace
>>> for m in dir(""):
... if m not in dir(string):
... print m
...
__add__
__class__
__contains__
__delattr__
__eq__
__ge__
__getattribute__
__getitem__
__getnewargs__
__getslice__
__gt__
__hash__
__init__
__le__
__len__
__lt__
__mod__
__mul__
__ne__
__new__
__reduce__
__reduce_ex__
__repr__
__rmod__
__rmul__
__setattr__
__str__
decode
encode
endswith
isalnum
isalpha
isdigit
islower
isspace
istitle
isupper
splitlines
startswith
title
More information about the Python-list
mailing list