Skip to content

Using introspection of Python (3) to know everything about a new object.

Notifications You must be signed in to change notification settings

aknirala/PythonIntrospection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

PythonIntrospection

Using introspection of Python(3) to know more about an object.

Usage

AnalyzeObj(obj)
AnalyzeObj(obj, exclRgEx=["__doc__", "__builtins__"])

obj: Name of the object. If suppose I want to know about details inside package sklearn (and I have already done import sklearn). I can simply do: AnalyzeObj(sklearn)

exclRgEx: The attributes of object which matches the regex list provided here would be ignored. It has some default value, thus passing an empty list would display all the attributes.

On execution it first display help(obj), user can skip it by typing q + Enter

Please note, the code just have two function (no classes), so the file could be loaded in REPL simply as:

with open('AnalyzeObj.py') as f:  #Assuming file is present in current directory.
    exec(f.read())

About

Using introspection of Python (3) to know everything about a new object.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages