Skip to content Skip to sidebar Skip to footer
Showing posts with the label Introspection

Why Use Getattr() Instead Of __dict__ When Accessing Python Object Attributes?

In source examples and SO answers that have some degree of Python object introspection, a common pa… Read more Why Use Getattr() Instead Of __dict__ When Accessing Python Object Attributes?

Sqlalchemy Introspect Column Type With Inheritance

Considering this code (and using SQLAlchemy 0.7.7): class Document(Base): __tablename__ = '… Read more Sqlalchemy Introspect Column Type With Inheritance

Python Inspect.stack Is Slow

I was just profiling my Python program to see why it seemed to be rather slow. I discovered that th… Read more Python Inspect.stack Is Slow

How To Check In Python From Which Class Methods Is Derived?

I have two classes: class A(object): def a(self): pass class B(A): def b(self): pass … Read more How To Check In Python From Which Class Methods Is Derived?

How To Call A Compiled Function Body?

When I get hold of a code object (via internals like .func_code or __code__ in Python 3), is there … Read more How To Call A Compiled Function Body?

Checking Up On A `concurrent.futures.threadpoolexecutor`

I've got a live concurrent.futures.ThreadPoolExecutor. I want to check its status. I want to kn… Read more Checking Up On A `concurrent.futures.threadpoolexecutor`

How To Introspectively Connect Handlers To Signals?

gtk.Builder is capable to identify all signals that a GUI (described in a XML file) can emit and wi… Read more How To Introspectively Connect Handlers To Signals?

Detecting Bound Method In Classes (not Instances) In Python 3

Given a class C with a function or method f, I use inspect.ismethod(obj.f) (where obj is an instanc… Read more Detecting Bound Method In Classes (not Instances) In Python 3