[Tutor] Better structure?
keridee at jayco.net
Wed Feb 2 03:23:10 CET 2005
So, how would one go about this in a non broken code way? Don't they have
something like what I'm requesting.
It seems to me that a few things are flawed in the standard distribution.
Little things like the overlooking of adding a method or function to decimal
for returning an instance with x places right of the decimal. I know of
quantize, but that's junk and not simple. Also why shouldn't string methods
include stuff like lstrip which do precisely what I request?
Maybe because they don't want to bother putting
as a method or something?
Messy, just plain messy.
> Jacob S. wrote:
>> I don't know who's going crazy here... but I checked that straight from
>> the python 2.4 interpreter...
> >>> a = "go on long buddy"
> >>> a.lstrip('gonl')
> ' on long buddy'
> >>> a.lstrip('gonl ')
> Note that in the second case, I've included a space in the lstrip()
> parameter. lstrip() is essentially saying "remove all leading characters
> until you find a character that's not in this sequence" --
> a space counts as a character. (Took me trying it out before I saw this,
> so don't feel bad. ;) )
> Jeff Shannon
> Credit International
> Tutor maillist - Tutor at python.org
More information about the Tutor