Just remember that Python is sexy

Scott Kirkwood scottakirkwood at gmail.com
Fri Jun 3 10:19:32 EDT 2005


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 <whereU at now.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.
> 
> 
> Genius! I will never perplex myself with string_foo.trim() again. (I do 
> forget)
> 
> I recommend this be adopted as a naming standard for Python methods:
> 
> "The method name should have a sexy connotation"
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> Eric Pederson
> http://www.songzilla.blogspot.com
> :::::::::::::::::::::::::::::::::::
> domainNot="@something.com <http://something.com>"
> domainIs=domainNot.replace("s","z")
> ePrefix="".join([chr(ord(x)+1) for x in "do"])
> mailMeAt=ePrefix+domainIs
> :::::::::::::::::::::::::::::::::::
> 
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20050603/a0d2f492/attachment.html>


More information about the Python-list mailing list