I'm using subprocess.Popen() to create a child process. The child process is
inheriting the parent process' open sockets, but I don't want that. I believe
that on Unix systems I could use the FD_CLOEXEC flag, but I'm running Windows.
Any suggestions?
--
http://mail.python.org/mailman/listinfo/p
I'm trying to do something like this in Python 2.4.3:
class NamedSet(set):
def __init__(self, items=(), name=''):
set.__init__(self, items)
self.name = name
class NamedList(list):
def __init__(self, items=(), name=''):
list.__init__(self, items)
self.name = name
I can do:
>>
PEP 8 says, "Comparisons to singletons like None should always be done
with 'is' or 'is not', never the equality operators." I know that "is"
is an identity operator, "==" and "!=" are the equality operators, but
I'm not sure what other singletons are being referred to here.
Also, I've seen code t
I know that the standard idioms for clearing a list are:
(1) mylist[:] = []
(2) del mylist[:]
I guess I'm not in the "slicing frame of mind", as someone put it, but
can someone explain what the difference is between these and:
(3) mylist = []
Why are (1) and (2) preferred? I think the fi