On Tue, 2005-02-22 at 11:16, Guido van Rossum wrote:
Really? I do this kind of thing all the time:
import os
import errno
try:
os.makedirs(dn)
except OSError, e:
if e.errno errno.EEXIST:
raise
You have a lot more faith in the errno module than I do. Are you
You have a lot more faith in the errno module than I do. Are you sure
the same error codes work on all platforms where Python works?
No, but I'm pretty confident the symbolic names for the errors are
consistent for any platform I've cared about wink.
It's also not exactly readable (except
On Tue, 22 Feb 2005 08:16:52 -0800, Guido van Rossum
[EMAIL PROTECTED] wrote:
Really? I do this kind of thing all the time:
import os
import errno
try:
os.makedirs(dn)
except OSError, e:
if e.errno errno.EEXIST:
raise
You have a lot more faith in the errno
Anyway, can you explain why LBYL is bad?
In the general case, it's bad because of a combination of issues. It
may violate once, and only once! -- the operations one needs to check
may basicaly duplicate the operations one then wants to perform. Apart
from wasted effort, it may happen
On 2005 Feb 20, at 05:20, Raymond Hettinger wrote:
...
This sort of thing is easy to test for and easy to fix. The question
is
whether we care about updating this module anymore or is it a relic.
Also, is the use case one that we care about. AFAICT, this has never
come up before.
I did have
Alex Martelli wrote:
On 2005 Feb 20, at 17:06, Guido van Rossum wrote:
Oh, bah. That's not what basestring was for. I can't blame you or your
client, but my *intention* was that basestring would *only* be the
base of the two *real* built-in string types (str and unicode).
I think all this just
At 04:32 PM 2/21/05 +1300, Greg Ewing wrote:
Alex Martelli wrote:
The need to check is this thingy here string-like is sort of frequent,
because strings are sequences which, when iterated on, yield sequences
(strings of length 1) which, when iterated on, yield sequences ad infinitum.
Yes, this