Yes,
but we don't want it to get out of hand, like calling it orgy() instead of join().
Or condom() instead of secure().
Or onClimax() instead of onFinished()
:-)On 5/31/05, Eric Pederson <[EMAIL PROTECTED]> wrote:
> I often can't remember that to remove spaces from a string whether it's> strip()
> I often can't remember that to remove spaces from a string whether it's
> strip() or trim(), and when finding patterns with the re library
> whether it's find() or search() and when iterating over key, values of
> a dictionary whether it's items() or entries().
> But then I remember that Python i
> "Greg" == Greg Ewing <[EMAIL PROTECTED]> writes:
>> The name index implies it returns something you can use as an index
>> to get at the substring.
Greg> But that's no fun -- it doesn't involve sex!
Greg> How about this: "index" and "sex" both end with "ex", which
Greg>
Duncan Booth wrote:
> The name index implies it returns something you can use as an index to get
> at the substring.
But that's no fun -- it doesn't involve sex!
How about this: "index" and "sex" both end with "ex", which
is short for "exception".
(Of course, you could get straight from "index
Sion Arrowsmith wrote:
>>The name index implies it returns something you can use as an index to
>>get at the substring.
>
> Unfortunately, -1 can of course be used as an index. Mind you, it
> would be perverse to expect to find the substring at it.
>
That was my point. The returned index always
Duncan Booth <[EMAIL PROTECTED]> wrote:
>Ville Vainio wrote:
>>> "Peter" == Peter Hansen <[EMAIL PROTECTED]> writes:
>> Peter> Sion Arrowsmith wrote:
>> >> But can you come up with a method for remembering which way
>> >> round str.find() and str.index() are?
>>
>> Peter> Don'
Ville Vainio wrote:
>>"Peter" == Peter Hansen <[EMAIL PROTECTED]> writes:
> Peter> Sion Arrowsmith wrote:
> >> But can you come up with a method for remembering which way
> >> round str.find() and str.index() are?
>
> Peter> Don't use "str" and you won't have anything to rememb
Ville Vainio wrote:
>> "Peter" == Peter Hansen <[EMAIL PROTECTED]> writes:
>
> Peter> Sion Arrowsmith wrote:
> >> But can you come up with a method for remembering which way
> >> round str.find() and str.index() are?
>
> Peter> Don't use "str" and you won't have anything to r
> "Peter" == Peter Hansen <[EMAIL PROTECTED]> writes:
Peter> Sion Arrowsmith wrote:
>> But can you come up with a method for remembering which way
>> round str.find() and str.index() are?
Peter> Don't use "str" and you won't have anything to remember:
Peter> 'foo bar baz'
Sion Arrowsmith wrote:
> But can you come up with a method for remembering which way
> round str.find() and str.index() are?
Don't use "str" and you won't have anything to remember:
'foo bar baz'.find('spam')
'spanish inquisition'.index('parrot')
-Peter
--
http://mail.python.org/mailman/listinf
Scott Kirkwood <[EMAIL PROTECTED]> wrote:
>I often can't remember that to remove spaces from a string whether it's
>strip() or trim(), and when finding patterns with the re library
>whether it's find() or search() and when iterating over key, values of
>a dictionary whether it's items() or entries(
:-)
--
http://mail.python.org/mailman/listinfo/python-list
Silly but true. It started with trying to figure how to remember it's
strip() and not trim().
Then it went downhill from there.
--
http://mail.python.org/mailman/listinfo/python-list
Scott Kirkwood wrote:
> I often can't remember that to remove spaces from a string whether
it's
> strip() or trim(), and when finding patterns with the re library
> whether it's find() or search() and when iterating over key, values
of
> a dictionary whether it's items() or entries().
> But then I
I often can't remember that to remove spaces from a string whether it's
strip() or trim(), and when finding patterns with the re library
whether it's find() or search() and when iterating over key, values of
a dictionary whether it's items() or entries().
But then I remember that Python is "sexy".
15 matches
Mail list logo