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
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
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
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
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()
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
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
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.
> >
>
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
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
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
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 : >>
12 matches
Mail list logo