Questions tagged [inspect]

DO NOT USE! THIS IS AMBIGUOUS. You might be looking for [web-inspector].

610 questions
2
votes
1 answer

Django: find all OneToOneFields pointing to a Model

I'm writing routines to inspect an instance and find all its relations (e.g. using instance._meta.get_all_related_objects()) but I can't find a way to get relations involving a OneToOneField. For instance, with these two models: class…
Don
  • 16,928
  • 12
  • 63
  • 101
2
votes
2 answers

How to look up functions of a library in python?

I just installed this library that scrapes twitter data: https://github.com/kennethreitz/twitter-scraper I wanted to find out the library's functions and methods so I can start interacting with the library. I have looked around StackOverflow on this…
2
votes
1 answer

How to import method-wrapper type?

I have a library module-wrapper that recursively wraps objects. I want to determine if an object has a function-like type. I can check almost all function-like object using: inspect.isbuiltin(object=obj) or inspect.isfunction(object=obj)…
rominf
  • 2,719
  • 3
  • 21
  • 39
2
votes
2 answers

Smalltalk equivalent of Inspect tool for windows

Is there a Smalltalk equivalent of Inspect tool that is available for Microsoft Windows or something like inspect option available in Web browsers From what I've researched, Smalltalk allows run-time reflection. I think this is more related to…
Vasantha Ganesh
  • 4,570
  • 3
  • 25
  • 33
2
votes
1 answer

Custom CSS to remove specific margins on Wordpress page

Recently I've made a new Wordpress crew page for my team. I'm using the visual composer plugin to put it all together. Unfortunately, The Wordpress theme adds a margin between the two sides that I cannot remove using visual composer. (see here)…
2
votes
1 answer

How to correctly "stub" __objclass__ in a Python class?

I have Python class looking somewhat like this: class some_class: def __getattr__(self, name): # Do something with "name" (by passing it to a server) Sometimes, I am working with ptpython (an interactive Python shell) for debugging.…
s-m-e
  • 3,433
  • 2
  • 34
  • 71
2
votes
0 answers

Failed Prop Type supplied to View/RCT View when using element inspector

When using the element inspector, occasionally when I click on certain elements I get this error: screenshot. I am using extended stylesheet, (and redux form, but I don't think the bug is related to redux form, it just exhibits a symptom of it)…
2
votes
1 answer

getting an element's EventListeners

In safari's (and chrome's) element inspector there's an "Event Listeners" section (in the right frame of the elements tab) that show's the Event Listeners in the document. Is there anything similar in firebug? Also, is it possible to get an…
some student
  • 371
  • 1
  • 2
  • 8
2
votes
2 answers

Python Changing name of method

Using python 3.6. I'm trying to write some code that will allow me to to place a unique identifier on class methods. Here's an example: def test(func): def wrap(): pass wrap.__name__ += '_TEST' return wrap class example: …
James Schinner
  • 1,549
  • 18
  • 28
2
votes
2 answers

How to catch the input argument of a function in a dict

For logging purpose I tried to automatically catch the arguments passed to a function inside this function and convert them to a dict of arg : value. I tried the inspect.signature() module but it only provides with the default input of the function…
MCMZL
  • 1,078
  • 9
  • 21
2
votes
1 answer

Inspecting a stopped docker container on python using inspect_container

I'm coding tests with python. I want to make a method that outputs the status of a container (running/exited). import docker class Container: def __init__(self, name, image, *, command=[], links={}): self._docker =…
2
votes
0 answers

Chrome caught with function(){debugger()} in web page using inspect

When trying to look at web pages that have excessive amounts of ads in them using Chrome's inspect, I find that some of them now have an embedded function(){debugger;} clause in them. Chrome brings up a panel like this: (function()…
fubar
  • 21
  • 3
2
votes
3 answers

Including the current method name when printing in Python

Often times in C programs (and using GCC) I will create a debug print macro that includes the name of the current function. That is, something like: #define DPRINTF(fmt, ...) printf("[%s] " fmt, __FUNCTION__, ##__VA_ARGS__) When used, the current…
sherrellbc
  • 4,650
  • 9
  • 48
  • 77
2
votes
0 answers

Alternative to inspect.getsourcelines() that includes super() code when inheriting from parent class in Python

I want to be able to print out a "flattened" version of a class - viewing the source code of Class B which inherits methods from Class A but as if it were written as a single class without inheritance. The Python inspect module provides the…
Neal
  • 3,102
  • 1
  • 14
  • 16
2
votes
2 answers

Python: inspect where an exception raise would go

Take this code: def A(): try: B() except Exception: pass def B(): C() def C(): print exception_handling_pointer() A() The function exception_handling_pointer should return me a pointer to the function where this specific…
Albert
  • 65,406
  • 61
  • 242
  • 386