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

How Can I Programmatically Change The Argspec Of A Function In A Python Decorator?

Given a function: def func(f1, kw='default'): pass bare_argspec = inspect.getargspec(fu… Read more How Can I Programmatically Change The Argspec Of A Function In A Python Decorator?

Loading Source Code With Inspect.getsource() Fails Saying It Can't Read A Built-in Class. (it's Not)

When I load the source code of a class from a module directly, it's fine: import arg_master ins… Read more Loading Source Code With Inspect.getsource() Fails Saying It Can't Read A Built-in Class. (it's Not)

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