Re: rstrip()

2010-07-19 Thread News123
Dennis Lee Bieber wrote: > On Sun, 18 Jul 2010 17:49:11 +0100, MRAB > declaimed the following in gmane.comp.python.general: > >> How about 'strip_str', 'lstrip_str' and 'rstrip_str', or something > > Not sure what the first would do... unless one is envisioning > > "abracadabra".str

Re: rstrip()

2010-07-18 Thread python
And don't forget the oft requested strip_tease(). Malcolm -- http://mail.python.org/mailman/listinfo/python-list

Re: rstrip()

2010-07-18 Thread Ethan Furman
MRAB wrote: [snip] How about 'strip_str', 'lstrip_str' and 'rstrip_str', or something similar? +1 on the names ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: rstrip()

2010-07-18 Thread News123
MRAB wrote: > News123 wrote: >> Thomas Jollans wrote: >> >>> string.rstrip( [ '-dir' ] ) or as string.rstrip( '-dir' ) >>> The former should certainly raise an exception. '-dir' is not a single >>> character ! >>> Or it should actually strip '-dir', or '-dir-dir', but not 'r--i'...

Re: rstrip()

2010-07-18 Thread MRAB
News123 wrote: Thomas Jollans wrote: string.rstrip( [ '-dir' ] ) or as string.rstrip( '-dir' ) The former should certainly raise an exception. '-dir' is not a single character ! Or it should actually strip '-dir', or '-dir-dir', but not 'r--i'... but that's just silly. It's silly with the

Re: rstrip()

2010-07-18 Thread News123
Thomas Jollans wrote: > > >> string.rstrip( [ '-dir' ] ) >> or as >> string.rstrip( '-dir' ) > > The former should certainly raise an exception. '-dir' is not a single > character ! > Or it should actually strip '-dir', or '-dir-dir', but not 'r--i'... but > that's just silly. > It's silly wi

Re: rstrip()

2010-07-18 Thread Thomas Jollans
On 07/18/2010 01:18 PM, News123 wrote: > Mark Lawrence wrote: >> On 17/07/2010 23:17, MRAB wrote: >>> Chris Rebert wrote: On Fri, Jul 16, 2010 at 10:27 AM, MRAB wrote: > Jason Friedman wrote: It's a pity that str.strip() doesn't actually take a set() of length-1 string

Re: rstrip()

2010-07-18 Thread News123
Mark Lawrence wrote: > On 17/07/2010 23:17, MRAB wrote: >> Chris Rebert wrote: >>> On Fri, Jul 16, 2010 at 10:27 AM, MRAB >>> wrote: Jason Friedman wrote: >>> >>> It's a pity that str.strip() doesn't actually take a set() of length-1 >>> strings, which would make its behavior more obvious and

Re: rstrip()

2010-07-17 Thread Mark Lawrence
On 17/07/2010 23:17, MRAB wrote: Chris Rebert wrote: On Fri, Jul 16, 2010 at 10:27 AM, MRAB wrote: Jason Friedman wrote: $ python Python 2.6.4 (r264:75706, Dec 7 2009, 18:43:55) [GCC 4.4.1] on linux2 Type "help", "copyright", "credits" or "license" for more information. "x.vsd-dir".rstrip("-

Re: rstrip()

2010-07-17 Thread MRAB
Chris Rebert wrote: On Fri, Jul 16, 2010 at 10:27 AM, MRAB wrote: Jason Friedman wrote: $ python Python 2.6.4 (r264:75706, Dec 7 2009, 18:43:55) [GCC 4.4.1] on linux2 Type "help", "copyright", "credits" or "license" for more information. "x.vsd-dir".rstrip("-dir") 'x.vs' I expected 'x.vsd'

Re: rstrip()

2010-07-17 Thread Chris Rebert
On Fri, Jul 16, 2010 at 10:27 AM, MRAB wrote: > Jason Friedman wrote: >> >> $ python >> Python 2.6.4 (r264:75706, Dec  7 2009, 18:43:55) >> [GCC 4.4.1] on linux2 >> Type "help", "copyright", "credits" or "license" for more information. > > "x.vsd-dir".rstrip("-dir") >> >> 'x.vs' >> >> I ex

Re: rstrip()

2010-07-17 Thread News123
Jason Friedman wrote: > $ python > Python 2.6.4 (r264:75706, Dec 7 2009, 18:43:55) > [GCC 4.4.1] on linux2 > Type "help", "copyright", "credits" or "license" for more information. "x.vsd-dir".rstrip("-dir") > 'x.vs' > > I expected 'x.vsd' as a return value. This is kind of similiar to the q

Re: rstrip()

2010-07-16 Thread Novocastrian_Nomad
On Jul 16, 10:58 am, Jason Friedman wrote: > $ python > Python 2.6.4 (r264:75706, Dec  7 2009, 18:43:55) > [GCC 4.4.1] on linux2 > Type "help", "copyright", "credits" or "license" for more information. >>> "x.vsd-dir".rstrip("-dir") > > 'x.vs' > > I expected 'x.vsd' as a return value. One way to

Re: rstrip()

2010-07-16 Thread MRAB
Jason Friedman wrote: $ python Python 2.6.4 (r264:75706, Dec 7 2009, 18:43:55) [GCC 4.4.1] on linux2 Type "help", "copyright", "credits" or "license" for more information. "x.vsd-dir".rstrip("-dir") 'x.vs' I expected 'x.vsd' as a return value. .strip, .lstrip and .rstrip treat their argumen

Re: rstrip()

2010-07-16 Thread Ken Watford
On Fri, Jul 16, 2010 at 12:58 PM, Jason Friedman wrote: > $ python > Python 2.6.4 (r264:75706, Dec  7 2009, 18:43:55) > [GCC 4.4.1] on linux2 > Type "help", "copyright", "credits" or "license" for more information. "x.vsd-dir".rstrip("-dir") > 'x.vs' > > I expected 'x.vsd' as a return value.

Re: rstrip()

2010-07-16 Thread Thomas Jollans
On 07/16/2010 06:58 PM, Jason Friedman wrote: > $ python > Python 2.6.4 (r264:75706, Dec 7 2009, 18:43:55) > [GCC 4.4.1] on linux2 > Type "help", "copyright", "credits" or "license" for more information. "x.vsd-dir".rstrip("-dir") > 'x.vs' > > I expected 'x.vsd' as a return value. >>> "x-vs

Re: rstrip()

2010-07-16 Thread Shashwat Anand
On Fri, Jul 16, 2010 at 10:28 PM, Jason Friedman wrote: > $ python > Python 2.6.4 (r264:75706, Dec 7 2009, 18:43:55) > [GCC 4.4.1] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> "x.vsd-dir".rstrip("-dir") > 'x.vs' > > I expected 'x.vsd' as a return value.

Re: rstrip error python2.4.3 not in 2.5.1?

2008-02-29 Thread Tim Roberts
dirkheld <[EMAIL PROTECTED]> wrote: >> >> What is the actual error message [SyntaxError, NameError? etc] that you >> clipped? > >Here it is : I tought that I didn't matter because the deliciousapi >worked fine on my mac. > >Traceback (most recent call last): > File "delgraph.py", line 62, in ? >

Re: rstrip error python2.4.3 not in 2.5.1?

2008-02-29 Thread Philipp Pagel
dirkheld <[EMAIL PROTECTED]> wrote: > Here it is : I tought that I didn't matter because the deliciousapi > worked fine on my mac. > Traceback (most recent call last): > File "delgraph.py", line 62, in ? > url_metadata = d.get_url(site.rstrip()) > File "deliciousapi.py", line 269, in get_

Re: rstrip error python2.4.3 not in 2.5.1?

2008-02-29 Thread dirkheld
> > What is the actual error message [SyntaxError, NameError? etc] that you > clipped? Here it is : I tought that I didn't matter because the deliciousapi worked fine on my mac. Traceback (most recent call last): File "delgraph.py", line 62, in ? url_metadata = d.get_url(site.rstrip()) F

Re: rstrip error python2.4.3 not in 2.5.1?

2008-02-28 Thread subeen
rstrip() works fine in python 2.4.3. May be the problem lies in somewhere else. I tried it in FC6 with Python 2.4.3: >>> url = "abc.com\n" >>> url.rstrip() 'abc.com' regards, Subeen. http://love-python.blogspot.com/ On Feb 29, 2:30 am, dirkheld <[EMAIL PROTECTED]> wrote: > Hi, > > I wrote some

Re: rstrip error python2.4.3 not in 2.5.1?

2008-02-28 Thread Terry Reedy
"dirkheld" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | Hi, | | I wrote some python code that retrieves urls from a txt file. In this | code I use .rstrip() for removing the '\n' at the end of every url. | While this code works on my mac (leopard) with python 2.5.1, this same | c