469,609 Members | 1,276 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,609 developers. It's quick & easy.

String functions deprication

http://www.python.org/doc/2.4.1/lib/node110.html

These methods are being deprecated. What are they being replaced
with? Does anyone know?

Steve
Aug 16 '05 #1
3 3124
steve morin wrote:
http://www.python.org/doc/2.4.1/lib/node110.html

These methods are being deprecated. What are they being replaced
with? Does anyone know?

Steve


It might be helpful to compare the following lists.

Python 2.1 (#1, May 23 2003, 11:43:56) [C] on aix4
Type "copyright", "credits" or "license" for more information.
import string
dir(string) ['_StringType', '__builtins__', '__doc__', '__file__', '__name__',
'_float', '_idmap', '_idmapL', '_int', '_long', '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', 'rstrip', 'split',
'splitfields', 'strip', 'swapcase', 'translate', 'upper', 'uppercase',
'whitespace', 'zfill'] s = "now"
dir(s) ['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'] for m in dir(string): .... if m not in dir(s):
.... print m
....
_StringType
__builtins__
__doc__
__file__
__name__
_float
_idmap
_idmapL
_int
_long
atof
atof_error
atoi
atoi_error
atol
atol_error
capwords
digits
hexdigits
index_error
joinfields
letters
lowercase
maketrans
octdigits
printable
punctuation
splitfields
uppercase
whitespace
zfill for m in dir(s):

.... if m not in dir(string):
.... print m
....
encode
endswith
isalnum
isalpha
isdigit
islower
isspace
istitle
isupper
splitlines
startswith
title
Aug 16 '05 #2
steve morin wrote:
http://www.python.org/doc/2.4.1/lib/node110.html

These methods are being deprecated. What are they being replaced
with? Does anyone know?

Steve


It might be helpful to compare the following lists.

Python 2.1 (#1, May 23 2003, 11:43:56) [C] on aix4
Type "copyright", "credits" or "license" for more information.
import string
dir(string) ['_StringType', '__builtins__', '__doc__', '__file__', '__name__',
'_float', '_idmap', '_idmapL', '_int', '_long', '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', 'rstrip', 'split',
'splitfields', 'strip', 'swapcase', 'translate', 'upper', 'uppercase',
'whitespace', 'zfill'] s = "now"
dir(s) ['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'] for m in dir(string): .... if m not in dir(s):
.... print m
....
_StringType
__builtins__
__doc__
__file__
__name__
_float
_idmap
_idmapL
_int
_long
atof
atof_error
atoi
atoi_error
atol
atol_error
capwords
digits
hexdigits
index_error
joinfields
letters
lowercase
maketrans
octdigits
printable
punctuation
splitfields
uppercase
whitespace
zfill for m in dir(s):

.... if m not in dir(string):
.... print m
....
encode
endswith
isalnum
isalpha
isdigit
islower
isspace
istitle
isupper
splitlines
startswith
title
Aug 16 '05 #3
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
Aug 16 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Carl Youngblood | last post: by
19 posts views Thread by Mike Tyka | last post: by
1 post views Thread by Dan | last post: by
2 posts views Thread by Tim Conner | last post: by
29 posts views Thread by zoro | last post: by
14 posts views Thread by =?Utf-8?B?Sm9hY2hpbQ==?= | last post: by
15 posts views Thread by Cartoper | last post: by
reply views Thread by devrayhaan | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.