it's on the slide after that. I think he says he committed that on python 3.x but of course its backportable.
Il giorno lunedì 22 luglio 2013 17:35:03 UTC+2, Richard ha scritto: > > Thanks for sharing Simone! > > Appreciate! > > I notice one change that can improve web2py, but not seems available in > python 2.7 : > > with ignore(OSError): > os.unlink(filename) > > In replacement to : > > if os.path.exists(filename): > os.unlink(filename) > > > https://speakerdeck.com/pyconslides/transforming-code-into-beautiful-idiomatic-python-by-raymond-hettinger-1?slide=37 > http://mmoya.org/blog/2013/03/17/python-gets-a-new-ignored-context-manager/ > > Seems that there is a small risk of concurent access with os.path.exists() > and os.unlink() > > http://stackoverflow.com/questions/10840533/most-pythonic-way-to-delete-a-file-which-may-not-exist > > :) > > Richard > > > > > On Sun, Jul 21, 2013 at 6:07 PM, Niphlod <[email protected] > <javascript:>>wrote: > >> I actually skipped over this a few times and today I finally reached its >> place in my playlist for free time... sorry if you seen it before, but I >> actually learned at least 5 things out of it that I reaaaaally didn't know >> of. >> >> https://www.youtube.com/watch?v=OSGv2VnC0go >> >> if you want slides >> >> >> https://speakerdeck.com/pyconslides/transforming-code-into-beautiful-idiomatic-python-by-raymond-hettinger-1 >> >> -- >> >> --- >> You received this message because you are subscribed to the Google Groups >> "web2py-users" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected] <javascript:>. >> For more options, visit https://groups.google.com/groups/opt_out. >> >> >> > > -- --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.

