Language Features

PyInspect

Python stdlib module — inspect. Auto-indexed from CDN. Method-level security roles have not been annotated; rule writers should inspect the source before use.

Other Methods

.classify_class_attrs()Neutral
#
Signature
classify_class_attrs(cls)

Return list of attribute-descriptor tuples.

.cleandoc()Neutral
#
Signature
cleandoc(doc)

Clean up indentation from docstrings.

.currentframe()Neutral
#
Signature
currentframe()

Return the frame of the caller or None if this is not possible.

.findsource()Neutral
#
Signature
findsource(object)

Return the entire source file and starting line number for an object.

.formatannotation()Neutral
#
Signature
formatannotation(annotation, base_module)

formatannotation function.

.formatannotationrelativeto()Neutral
#
Signature
formatannotationrelativeto(object)

formatannotationrelativeto function.

.formatargvalues()Neutral
#
Signature
formatargvalues(args, varargs, varkw, locals, formatarg, formatvarargs, formatvarkw, formatvalue)

Format an argument spec from the 4 values returned by getargvalues.

.get_annotations()Neutral
#
Signature
get_annotations(obj, globals, locals, eval_str)

Compute the annotations dict for an object.

.getabsfile()Neutral
#
Signature
getabsfile(object, _filename)

Return an absolute path to the source or compiled file for an object.

.getargs()Neutral
#
Signature
getargs(co)

Get information about the arguments accepted by a code object.

Fully-Qualified Names

FQNField
inspectfqns[0]

Wrong FQN → 0 findings. Verify with: change fqns to garbage → must produce 0 results.

Import

rule.py
import inspect