Mercurial > hg > config
view python/subclass.py @ 619:fd50f457185c
STUB: python/install_config.py
author | Jeff Hammel <k0scist@gmail.com> |
---|---|
date | Tue, 04 Feb 2014 14:27:17 -0800 |
parents | e21c49e32b95 |
children |
line wrap: on
line source
import string from pprint import pprint class Foo: pass class Bar(Foo): pass fleem = 1 mystuff = {i:j for i, j in globals().items()} types = {i:type(j) for i, j in globals().items()} mynewstuff = {i:j for i, j in mystuff.items() if (type(j) == type(Foo)) and issubclass(j, Foo)} pprint(mynewstuff)