inspect

iPhone - is there any way to look at the core data store for a live app?

I've got a live app on the app store that's producing some strange results when the user upgrades versions that I can't reproduce in my dev environment. Does anyone know of a way to inspect the core data store of a live iPhone app? ...

Does dict.update affect a function's argspec?

import inspect class Test: def test(self, p, d={}): d.update(p) return d print inspect.getargspec(getattr(Test, 'test'))[3] print Test().test({'1':True}) print inspect.getargspec(getattr(Test, 'test'))[3] I would expect the argspec for Test.test not to change but because of dict.update it does. Why? ...

How can I inspect element like in Firebug via JavaScript ?

I need to have a user poke at an element on a website, almost exactly like with Firebug as a developer. Does anyone know a simple way to do this in JavaScript, or a library like YUI or jQuery? ...

Python: how does inspect.ismethod work?

I'm trying to get the name of all methods in my class. When testing how the inspect module works, i extraced one of my methods by obj = MyClass.__dict__['mymethodname']. But now inspect.ismethod(obj) returns False while inspect.isfunction(obj) returns True, and i don't understand why. Is there some strange way of marking methods as met...

How to inspect an object in script like in scala console?

When I use scala console, it prints an object in a clear style, e.g. scala> val mike = ("mike", 40, "New York") mike: (java.lang.String, Int, java.lang.String) = (mike,40,New York) But if I write in a script file, like: val mike = ("mike", 40, "New York") println(mike) It only prints: (mike,40,New York) How can I do in script fi...

How to use inspect to get the caller's info from callee?

I need to get the caller info (what file/what line) from callee. I learned that I can use inpect module for that for purposes, but not exactly how. How to get those info with inspect? Or is there any other way to get the info? import inspect print __file__ c=inspect.currentframe() print c.f_lineno def hello(): print inspect.stack...

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(func) @decorator def func2(f1, kw='default'): pass decorated_argspec = inspect.getargspec(func2) How can I create a decorator such that bare_argspec == decorated_argspec? (As to why, the framework that calls the decorated function does argsp...

Object address in Ruby

Short version: The default inspect method for a class displays the object's address.* How can I do this in a custom inspect method of my own? *(To be clear, I want the 8-digit hex number you would normally get from inspect. I don't care about the actual memory address. I'm just calling it a memory address because it looks like one. ...