Granularity of OSError

ryles rylesny at gmail.com
Sun Sep 20 22:39:05 CEST 2009


On Sep 19, 9:22 pm, MRAB <pyt... at mrabarnett.plus.com> wrote:
> The point is that it's sometimes a good idea to do a cheap check first
> before attempting an operation that's 'expensive' even when it fails.

Strongly agree. Furthermore, with LBYL it's often easier to give a
user clearer error messages for common usage errors, rather than
waiting for an exception in a much lower-level place where it's less
clear to them what the cause is.



More information about the Python-list mailing list