Fiyawerx wrote:
> Thanks Kent, thats just what I needed, but got stuck in a single mode of 
> thought trying to do it inline, didn't even think of adding a separate 
> function since the program seemed 'too simple'.

You can always use a lambda if you like that style:
newest = max(first_files, key=lambda f: os.stat(f).st_mtime)

I would probably write it that way myself, I used the def cuz I think it 
is a bit easier to understand.

Kent

> On 11/5/07, *Kent Johnson* <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> 
> wrote:
>     def fileTime(f):
>        return os.stat(f).st_mtime
> 
>     newest = max(first_files, key=fileTime)
> 
>     Kent
> 
> 

_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to