On Thu, Jan 15, 2009 at 1:03 PM, Lambert, David W (S&T)
<[email protected]> wrote:
> Overly terse. I do mean that this is illegal:
>
> isinstance(s, {str, bytes})
>
> tuples have order, immutability, and the possibility of repeat items.
>
> A set is most reasonable in a mathematical sense.
What's wrong with:
>>> a = ""
>>> b = bytes()
>>> any([isinstance(a, x) for x in {str, bytes}])
True
>>> any([isinstance(b, x) for x in {str, bytes}])
True
>>>
cheers
James
--
http://mail.python.org/mailman/listinfo/python-list