Re: [Python-Dev] NotHashableError? (Re: dict containment annoyance)

2006-08-13 Thread Scott Dial
Greg Ewing wrote: > Guido van Rossum wrote: >> try: >> hash(x) >> except TypeError: >> # apparently x is not hashable >> >> then you're also swallowing any type errors in the computation of a >> legitimate hash function. > > Maybe it would help if there were a specific exception, > such as Not

[Python-Dev] NotHashableError? (Re: dict containment annoyance)

2006-08-13 Thread Greg Ewing
Guido van Rossum wrote: > try: > hash(x) > except TypeError: > # apparently x is not hashable > > then you're also swallowing any type errors in the computation of a > legitimate hash function. Maybe it would help if there were a specific exception, such as NotHashableError, that hash functi

Re: [Python-Dev] dict containment annoyance

2006-08-13 Thread Guido van Rossum
On 8/13/06, Scott Dial <[EMAIL PROTECTED]> wrote: > FWIW, I think the logic of swallowing the TypeError is completely > reasonable. Then you haven't debugged enough Python programs. Swallowing an exception of *any* kind is always a trap waiting to shut when you least expect it, because you have n

[Python-Dev] test_socketserver failure on cygwin

2006-08-13 Thread Neal Norwitz
I'm not sure if this is a race condition in the test, the test using SocketServer inappropriately, or if the failure is exposing a problem in SocketServer. The issue is that when the second (UDP) server is setup, there is still a child process from the first (TCP) server. So when the UDP server c

Re: [Python-Dev] dict containment annoyance

2006-08-13 Thread Scott Dial
Jean-Paul Calderone wrote: > def blacklisted(o): > try: > # Is the object contained in the blacklist set? > return o in _blacklistset > except TypeError: > # If it *cannot* be contained in the blacklist set, > # then it probably isn't. > return False