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

Looping Over A Python / Ironpython Object Methods

What is the proper way to loop over a Python object's methods and call them? Given the object: … Read more Looping Over A Python / Ironpython Object Methods

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

Printing Names Of Variables Passed To A Function

In some circumstances, I want to print debug-style output like this: # module test.py def f() a =… Read more Printing Names Of Variables Passed To A Function

Find Module Name Of The Originating Exception In Python

Example: >>> try: ... myapp.foo.doSomething() ... except Exception, e: ... print … Read more Find Module Name Of The Originating Exception In Python