Refactoring; arbitrary expression in lists

Steven Bethard steven.bethard at gmail.com
Thu Jan 13 14:30:10 EST 2005


BJörn Lindqvist wrote:
>>    # do other non-extension-related tests here
>>    if basename.find( "Makefile" ) != -1:
>>        return "text/x-makefile"
> 
> 
> I believe this can be nicelier written as:
> 
> if "Makefile" in basename:
> 

+1 for "nicelier" as VOTW (Vocabulation of the week) =)

Steve



More information about the Python-list mailing list