3 3390
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
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
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', '_TemplateMetac lass', '__builtins__', '__doc__',
'__file__', '__name__', '_float', '_idmap', '_idmapL', '_int', '_long',
'_multimap', '_re', 'ascii_letters' , 'ascii_lowercas e',
'ascii_uppercas e', '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
_TemplateMetacl ass
__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 This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Carl Youngblood |
last post by:
I imagine this subject has probably been brought up numerous times.
Forgive me for bringing it up again. I was googling through old posts
on this newsgroup about it and found a good suggestion on how to add
functionality to the string class. Rather than trying to inherit from
the string class, the author was suggesting wrapping the string class
in another class, like so:
>Right !!!, we should not derive from string, but we should wrap...
|
by: Mike Tyka |
last post by:
Hello community,
i'm fairly new to using the STL but i've been experimenting a bit with it.
I tried to derive a new class say MyString from string like so:
class MyString: public string{
public:
MyString(){}
};
|
by: Dan |
last post by:
> http://www.python.org/doc/2.4.1/lib/node110.html
>
> These methods are being deprecated. What are they being replaced
> with?
They're being made methods of the string class itself.
For example:
>>> s = 'any old string'
>>> string.split(s, ' ') # Old way
|
by: Paul |
last post by:
hi, there,
for example,
char *mystr="##this is##a examp#le";
I want to replace all the "##" in mystr with "****". How can I do this?
I checked all the string functions in C, but did not find one.
|
by: Tim Conner |
last post by:
Hi,
Thanks to Peter, Chris and Steven who answered my previous answer about
regex to split a string. Actually, it was as easy as create a regex with the
pattern "/*-+()," and most of my string was splitted.
I am fascinated to the powerfull use of this RegEx class, so I wonder if it
could go a step further.
As a question, can regex be used to valid a set of different functions ?
Example : Suppose I have to verify the correctness of an...
| |
by: zoro |
last post by:
Hi,
I am new to C#, coming from Delphi. In Delphi, I am using a 3rd party
string handling library that includes some very useful string
functions, in particular I'm interested in BEFORE (return substring
before a pattern), AFTER (return substring after a pattern), and
BETWEEN (return substring between 2 patterns).
My questions are:
1. Can any tell me how I can implement such functionality in C#?
2. Is it possible to add/include function...
|
by: karthi |
last post by:
hi,
I need user defined function that converts string to float in c.
since the library function atof and strtod occupies large space in
my processor memory I can't use it in my code.
regards,
Karthi
|
by: Hitesh |
last post by:
Hi,
In python doc -- 4.1.4 Deprecated string functions -- I read that "The
following list of functions are also defined as methods of string and
Unicode objects; see ``String Methods'' (section 2.3.6) for more
information on those. You should consider these functions as
deprecated, although they will not be removed until Python 3.0. The
functions defined in this module are: " and there is a whole list of
functions. If these functions...
|
by: =?Utf-8?B?Sm9hY2hpbQ==?= |
last post by:
I have seen the following function to convert from a System::String^ to a
const wchar_t*. I would like to get a LPCTSTR and AFAIK LPCTSTR is equal to
const wchar_t*. Then it should all work right? But I only get the first
character. And when I try to do std::wstring l_s(convert(somestring)) I get
really strange characters into l_s string representation, but when I check
l_s individual characters they look ok.
const wchar_t* convert(...
|
by: Cartoper |
last post by:
There is one little static C library to manage the serial number and
unlock key for my application. Today it is compiled with Microsoft
VC6 and linked into both VC6 modules and VS2005 modules. It is not a
lot of code, but obviously it is very important code that is used all
over:
VS2005: used in a C++/CLI module for .Net
VS2005: Apache module
VC6: DLL that is called by the installation program
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |