Just remember that Python is sexy

Sion Arrowsmith siona at chiark.greenend.org.uk
Wed May 25 08:05:56 EDT 2005


Scott Kirkwood <scottakirkwood at gmail.com> 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 remember that Python is "sexy".
>It is sexier to strip() than to trim().
>You do a strip search() not a find() search.
>And you remove items() of clothing and not entries() of clothing.

But can you come up with a method for remembering which way
round str.find() and str.index() are?

-- 
\S -- siona at chiark.greenend.org.uk -- http://www.chaos.org.uk/~sion/
  ___  |  "Frankly I have no feelings towards penguins one way or the other"
  \X/  |    -- Arthur C. Clarke
   her nu becomeþ se bera eadward ofdun hlæddre heafdes bæce bump bump bump



More information about the Python-list mailing list