talin at acm dot org wrote:
> Although I realize the perils of even suggesting polluting the Python
> namespace with a new keyword, I often think that it would be useful to
> consider defining an operator for testing whether or not an item is a
> member of a category.

It's a good idea but not likely to be added to python, at least not til 
python 3000 comes out with type checking.  The default way is "if 
isinstance(image, jpeg)".
Also there is "if image |isa| jpeg:" using one of the various python 
hacks out there:
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/384122

But since Python doesn't have interfaces or type checking today, there 
really is not much need for isa or isinstance anyway, but you might use 
hasattr or try/except instead: http://www.canonical.org/~kragen/isinstance/
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to