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
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
tomer filiba wrote:
> [Aahz]
>> -1
>>
>> This is seriously no different from an attempt to do
>>
>> >>> a = {}
>> >>> a[ [] ] = 1
>
> how so? i'm not trying to modify/store anything in a dict.
> i'm only testing if a certain object is contained in the dict.
> that's totally different.
> imagine th
On Sat, 12 Aug 2006 18:57:02 +0200, tomer filiba <[EMAIL PROTECTED]> wrote:
>
>the logic is simple: every `x` is either contained in `y` or not.
>if `x` *cannot* be contained in `y`, then the answer is a "strong no",
>but that's still a "no".
>
def blacklisted(o):
try:
# Is the object
tomer filiba wrote:
a={1:2, 3:4}
[] in a
>
> Traceback (most recent call last):
> File "", line 1, in ?
> TypeError: list objects are unhashable
>
> imo, the expression should just evaluate to False instead of raising an
> exception. it's a question of semantics -- i asked whether the
On Sat, Aug 12, 2006, tomer filiba wrote:
>
> >>>a={1:2, 3:4}
> >>>[] in a
> Traceback (most recent call last):
> File "", line 1, in ?
> TypeError: list objects are unhashable
> >>>
>
> imo, the expression should just evaluate to False instead of raising an
> exception.
-1
This is seriously no