Re: Depricated String Functions in Python

2006-07-21 Thread Duncan Booth
Sybren Stuvel wrote: > Donn Cave enlightened us with: >> Oh, excellent - the string module is dead, long live the string >> module! I can replace string.join with str.join, and never have to >> defile my code with that ' '.join(x) abomination. > > It's not an abomination. It's a very clear way o

Re: Depricated String Functions in Python

2006-07-20 Thread Steve Holden
Donn Cave wrote: [...] > > Oh, excellent - the string module is dead, long live > the string module! I can replace string.join with > str.join, and never have to defile my code with that > ' '.join(x) abomination. > >>> lst = ['Steve', 'Holden'] >>> str.join(' ', lst) 'Steve Holden' >>> J

Re: Depricated String Functions in Python

2006-07-20 Thread Donn Cave
In article <[EMAIL PROTECTED]>, Steve Holden <[EMAIL PROTECTED]> wrote: > Anoop wrote: > > Thanks Stefen > > > > let me be more specific how would i have to write the following > > function in the deprecated format > > > > map(string.lower,list) > > > To avoid the deprecated usage you would us

Re: Depricated String Functions in Python

2006-07-20 Thread riquito
Steve Holden ha scritto: > Anoop wrote: > > Thanks Stefen > > > > let me be more specific how would i have to write the following > > function in the deprecated format > > > > map(string.lower,list) > > > To avoid the deprecated usage you would use the unbound method of the > str type (that's the

Re: Depricated String Functions in Python

2006-07-20 Thread Duncan Booth
Anoop wrote: > let me be more specific how would i have to write the following > function in the deprecated format > > map(string.lower,list) What you just wrote is the deprecated format. There are plenty of ways to write it in an undeprecated format. The simplest is probably: [ s.lower()

Re: Depricated String Functions in Python

2006-07-20 Thread Simon Forman
Anoop wrote: > Thanks Stefen > > let me be more specific how would i have to write the following > function in the deprecated format > > map(string.lower,list) > > Thanks Anoop Ah. This is easy enough: lower_list = [s.lower() for s in str_list] Or, if you really like map() (or really don't like

Re: Depricated String Functions in Python

2006-07-20 Thread Steve Holden
Anoop wrote: > Thanks Stefen > > let me be more specific how would i have to write the following > function in the deprecated format > > map(string.lower,list) > To avoid the deprecated usage you would use the unbound method of the str type (that's the type of all strings): >>> lst = ['Steve

Re: Depricated String Functions in Python

2006-07-20 Thread Anoop
Thanks Stefen let me be more specific how would i have to write the following function in the deprecated format map(string.lower,list) Thanks Anoop Stefan Behnel wrote: > Anoop wrote: > > Can any one help me out with the various depricated string functions > > that is followed in Python. > > >

Re: Depricated String Functions in Python

2006-07-20 Thread Steve Holden
John Machin wrote: > On 20/07/2006 5:18 PM, Steve Holden wrote: > >>Anoop wrote: >> >>>Hi All >>> >>>Can any one help me out with the various depricated string functions >>>that is followed in Python. >>> >>>For example how will be string.lower depricated. >>> >>>As far as string.lower('PYTHON') i

Re: Depricated String Functions in Python

2006-07-20 Thread John Machin
On 20/07/2006 5:18 PM, Steve Holden wrote: > Anoop wrote: >> Hi All >> >> Can any one help me out with the various depricated string functions >> that is followed in Python. >> >> For example how will be string.lower depricated. >> >> As far as string.lower('PYTHON') is concerned it is depricated a

Re: Depricated String Functions in Python

2006-07-20 Thread Steve Holden
Anoop wrote: > Hi All > > Can any one help me out with the various depricated string functions > that is followed in Python. > > For example how will be string.lower depricated. > > As far as string.lower('PYTHON') is concerned it is depricated as > 'PYTHON'.lower(). Both of them would return an

Re: Depricated String Functions in Python

2006-07-19 Thread Stefan Behnel
Anoop wrote: > Can any one help me out with the various depricated string functions > that is followed in Python. > > For example how will be string.lower depricated. > > As far as string.lower('PYTHON') is concerned it is depricated as > 'PYTHON'.lower(). Both of them would return an output : >>

Depricated String Functions in Python

2006-07-19 Thread Anoop
Hi All Can any one help me out with the various depricated string functions that is followed in Python. For example how will be string.lower depricated. As far as string.lower('PYTHON') is concerned it is depricated as 'PYTHON'.lower(). Both of them would return an output : >>> python Thanks fo