Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.mixmin.net!newsreader4.netcologne.de!news.netcologne.de!bcyclone03.am1.xlned.com!bcyclone03.am1.xlned.com!newsfeed.xs4all.nl!newsfeed1a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'string.': 0.04; 'strings.': 0.07; 'backwards': 0.09; 'created,': 0.09; 'received:openend.se': 0.09; 'received:theraft.openend.se': 0.09; 'subject:module': 0.09; 'subject:string': 0.09; 'cc:addr:python- list': 0.10; 'template': 0.11; 'cc:addr:lac': 0.16; 'cc:addr:openend.se': 0.16; 'from:addr:lac': 0.16; 'from:addr:openend.se': 0.16; 'from:name:laura creighton': 0.16; 'message-id:@fido.openend.se': 0.16; 'module?': 0.16; 'received:89.233': 0.16; 'received:89.233.217': 0.16; 'received:89.233.217.133': 0.16; 'received:fido': 0.16; 'received:fido.openend.se': 0.16; 'string': 0.17; 'exists': 0.18; 'laura': 0.18; 'cc:addr:python.org': 0.21; 'cc:2**1': 0.22; '2015': 0.23; 'module': 0.23; 'header:In-Reply-To:1': 0.24; 'mon,': 0.24; 'example': 0.25; 'module.': 0.27; '-0700,': 0.29; 'received:se': 0.29; 'cc:no real name:2**1': 0.29; 'code': 0.31; 'common': 0.33; 'subject:use': 0.33; 'subject:?': 0.34; 'lists': 0.34; 'could': 0.35; 'functions.': 0.35; 'really': 0.35; 'there': 0.36; "didn't": 0.37; 'subject:: ': 0.37; 'charset:us-ascii': 0.37; 'things': 0.39; 'some': 0.40; 'show': 0.62; 'header:Message- Id:1': 0.62; 'day': 0.70; 'online': 0.71; 'received:89': 0.80; 'thing,': 0.93 To: fl cc: python-list@python.org, lac@openend.se From: Laura Creighton Subject: Re: What use of string module? In-Reply-To: Message from fl of "Mon, 01 Jun 2015 19:14:18 -0700." References: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <23100.1433237969.1@fido> Date: Tue, 02 Jun 2015 11:39:29 +0200 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.9 (theraft.openend.se [89.233.217.130]); Tue, 02 Jun 2015 11:39:31 +0200 (CEST) X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 22 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1433237983 news.xs4all.nl 2866 [2001:888:2000:d::a6]:53878 X-Complaints-To: abuse@xs4all.nl X-Received-Bytes: 3991 X-Received-Body-CRC: 18080660 Xref: csiph.com comp.lang.python:91814 In a message of Mon, 01 Jun 2015 19:14:18 -0700, fl writes: >Hi, > >I read the online help about string. It lists string constants, string >formatting, template strings and string functions. After reading these, >I am still puzzled about how to use the string module. > >Could you show me a few example about this module? > >Thanks A long time ago, strings didn't have the methods they had now. So the string module was created, so that people could all have a common way to do some really common things that people like to do with strings. Now the strings have object methods to do the same thing, so you don't really want to use it. It's there for backwards compatibility. You don't want all the code that exists out there and uses it to all stop working one day because we now have a better way to do it. :) Laura