Need instruction on how to use isinstance

alex23 wuwei23 at gmail.com
Thu Jul 1 01:42:06 EDT 2010


Hans Mulder <han... at xs4all.nl> wrote:
> There's also: hasattr(<object>, '__call__').  It works in both 2.x and 3.x.

Good work, Hans. I do find that to be a more pythonic approach,
personally, being more concerned with an object's ability than its
abstract type.



More information about the Python-list mailing list