Re: [Tutor] Operating in Place

2010-09-28 Thread Steven D'Aprano
On Wed, 29 Sep 2010 06:12:20 am Shashwat Anand wrote: > On Wed, Sep 29, 2010 at 1:33 AM, Corey Richardson wrote: > > Hello tutors. > > > > I hate doing this: > >string = string.lower() > > > > Is there a way to do it without the "string =" part? Thanks. > > 1. string is a module whic

Re: [Tutor] Operating in Place

2010-09-28 Thread Steven D'Aprano
On Wed, 29 Sep 2010 06:03:21 am Corey Richardson wrote: > Hello tutors. > > I hate doing this: > string = string.lower() > > Is there a way to do it without the "string =" part? Thanks. No, strings are immutable. Once they're created, they cannot be changed. This is no different fr

Re: [Tutor] Operating in Place

2010-09-28 Thread Rance Hall
On Tue, Sep 28, 2010 at 3:03 PM, Corey Richardson wrote: >  Hello tutors. > > I hate doing this: >            string = string.lower() > > Is there a way to do it without the "string =" part? Thanks. > I suppose the best answer is it depends on what you are doing with string after you do string.lo

Re: [Tutor] Operating in Place

2010-09-28 Thread Steve Willoughby
On 28-Sep-10 13:03, Corey Richardson wrote: I hate doing this: string = string.lower() Is there a way to do it without the "string =" part? Thanks. Depends on the class. In this specific case, string objects are immutable (for some good reasons which are beyond the immediate point), so once

Re: [Tutor] Operating in Place

2010-09-28 Thread Wayne Werner
On Tue, Sep 28, 2010 at 3:03 PM, Corey Richardson wrote: > Hello tutors. > > I hate doing this: >string = string.lower() > > Is there a way to do it without the "string =" part? Thanks. > Not with a string. I suppose if you had your own class you could create something, but you'd be

Re: [Tutor] Operating in Place

2010-09-28 Thread Shashwat Anand
On Wed, Sep 29, 2010 at 1:33 AM, Corey Richardson wrote: > Hello tutors. > > I hate doing this: >string = string.lower() > > Is there a way to do it without the "string =" part? Thanks. > 1. string is a module which is deprecated. You should probably use str or s in your example. 2.

[Tutor] Operating in Place

2010-09-28 Thread Corey Richardson
Hello tutors. I hate doing this: string = string.lower() Is there a way to do it without the "string =" part? Thanks. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/li