DO NOT USE! THIS IS AMBIGUOUS. You might be looking for [web-inspector].
Questions tagged [inspect]
610 questions
11
votes
1 answer
Nested function decorators that operate on arguments in python
I am writing a function decorator that will apply a conversion to the first argument of the function. It works fine if I only decorate my functions once but if I decorate them twice I get an error. Below is some code that demonstrates the problem,…

Andrew Burrows
- 261
- 2
- 7
11
votes
2 answers
How do I reverse Hash.inspect or Array.inspect? (aka .to_s) in Ruby
I accidentally saved a Ruby hash to string in Ruby 1.9 by calling my_hash.to_s which is equal to my_hash.inspect. This gave me a string like this:
'{"foo"=>{"bar"=>"baz", "qux"=>"quux"}'
I now want to revert this back into a hash. How is this…

Cristiano Betta
- 247
- 3
- 13
11
votes
0 answers
Programmatically accessing [[Scopes]] (closure variables) through Chrome DevTools API or panel? (Not at breakpoint)
In 2014, it was not possible for JS code to access variables inside a closure from outside the closure. Since then, Chrome's internals have changed to use [[Scopes]] instead of Closure.
Is it now (2018) possible for Chrome DevTools to read…

cxw
- 16,685
- 2
- 45
- 81
11
votes
1 answer
How to show a dockerfile of image docker
I download a image from docker repository and Im trying to display the Dockerfile of 'X' image to create my own Dockerfile with the same structure to experiment with him. Im using this command:
docker inspect --format='{{.Config.Image}}' 'here paste…

Carlos Andres
- 12,740
- 7
- 18
- 34
11
votes
2 answers
How can I find out which capabilities a container has been given?
Say I run a container adding a capability, e.g. --cap-add=SYS_ADMIN
Is there a way to find out that this container has been assigned the SYS_ADMIN capability?
docker-inspect doesn't seem to return such information.

Marcello Romani
- 2,967
- 31
- 40
11
votes
3 answers
Python inspect.stack is slow
I was just profiling my Python program to see why it seemed to be rather slow. I discovered that the majority of its running time was spent in the inspect.stack() method (for outputting debug messages with modules and line numbers), at 0.005 seconds…

dpitch40
- 2,621
- 7
- 31
- 44
10
votes
3 answers
Get Python function's owning class from decorator
I have a decorator in PY. It is a method and takes the function as a parameter. I want to create a directory structure based based on the passed function. I am using the module name for the parent directory but would like to use the classname for…

Corey Coogan
- 1,569
- 2
- 17
- 31
10
votes
0 answers
How do I hide the new Chrome v84.0.4147.89 Issues Detected messages in the Console area?
Since latest Chrome update, version 84.0.4147.89 (Official Build) (64-bit)) on 14 July 20, when I open the brower's Inspection (debugging) panel, I see 'Issues detected: The new Issues tab displays information about deprecations, breaking changes…
user2505564
10
votes
2 answers
How to check if the docker image has all the files?
Is there a way to check if the docker image has all of the files that the Dockerfile copies over and to understand if the image is built as configured in the Dockerfile? My situation is that the image is built successfully, however when I try…

sharman
- 515
- 1
- 5
- 18
10
votes
0 answers
List modules in namespace package
I'm trying to get Python to list all modules in a namespace package.
I have the following file structure:
cwd
|--a
| `--ns
| |--__init__.py
| `--amod.py
|--b
| `--ns
| |--__init__.py
| `--bmod.py
`--c
`--ns
|--__init__.py
…

siebz0r
- 18,867
- 14
- 64
- 107
9
votes
1 answer
Does Firefox have an equivalent to chrome://inspect?
In Chrome you can go to chrome://inspect to go to the debug page. Does Firefox have anything like this?

1.21 gigawatts
- 16,517
- 32
- 123
- 231
9
votes
2 answers
Python: how to get the *full* name of the function I am in
Is there a way so that the following code:
import traceback
def log(message):
print "%s: %s" %(traceback.extract_stack()[0:-1][-1][2], message)
def f1():
log("hello")
class cls(object):
def f1(self):
log("hi…

Julien REINAULD
- 599
- 2
- 5
- 18
9
votes
2 answers
How can I find out where an object has been instantiated?
I'm trying to find out, at runtime, where an object has been instantiated, as this would enable providing a very useful error message to users of my library.
Suppose we have the following code:
import mylib
obj = mylib.MyClass()
obj is then passed…

Brecht Machiels
- 3,181
- 3
- 25
- 38
9
votes
2 answers
Python inspect.getargspec with built-in function
I'm trying to figure out the arguments of a method retrieved from a module.
I found an inspect module with a handy function, getargspec.
It works for a function that I define, but won't work for functions from an imported module.
import math,…

PeetWc
- 184
- 2
- 5
8
votes
3 answers
Equivalent of `util.inspect` in Deno
Does Deno have a utility function that dumps a Object or primitive to a string like Node.js util.inspect?
For example in Node.js I create an json object and want to dump out its contents in Node:
> m = {k1:'v1', k2:'v2'}
{ k1: 'v1', k2: 'v2' }
>…

Timothy C. Quinn
- 3,739
- 1
- 35
- 47