Refactoring; arbitrary expression in lists

BJörn Lindqvist bjourne at gmail.com
Thu Jan 13 14:14:39 EST 2005


>     # 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:

-- 
mvh Björn



More information about the Python-list mailing list