A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-list/2001-April/065963.html below:

Newbie question: how to determine "is-a" relationship

Newbie question: how to determine "is-a" relationship Newbie question: how to determine "is-a" relationshipRobert Roy rjroy at takingcontrol.com
Thu Apr 19 14:00:47 EDT 2001
On Thu, 19 Apr 2001 10:46:53 -0500, "Jake Baker" <jbaker at ummelec.com>
wrote:

>Gosh. I've been using Python since 96 and I don't know this! Wow!
>
>Say I have a class heirarchy that looks like A, B <- A, C <- A, etc....
>
>I have a list of objects (which I know arbitrarily are all A or sublasses =
>of A) and want to filter them based on which subclass they are.
>
>How do I go about doing this? You help is greatly appreciated!
>
>Thanks,
> - Jake Baker
>
>
I think that instanceof will do the trick. See the Python Library
Reference under Built-in Functions (Doc\lib\built-in-funcs.html)

Bob


More information about the Python-list mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4