Language Features

PyDis

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

Other Methods

.code_info()Neutral
#
Signature
code_info(x)

Formatted details of methods, functions, or code.

.dis()Neutral
#
Signature
dis(x, file, depth, show_caches, adaptive)

Disassemble classes, methods, functions, and other compiled objects.

.disassemble()Neutral
#
Signature
disassemble(co, lasti, file, show_caches, adaptive)

Disassemble a code object.

.disco()Neutral
#
Signature
disco(co, lasti, file, show_caches, adaptive)

Disassemble a code object.

.distb()Neutral
#
Signature
distb(tb, file, show_caches, adaptive)

Disassemble a traceback (default: last traceback).

.findlabels()Neutral
#
Signature
findlabels(code)

Detect all offsets in a byte code which are jump targets.

.findlinestarts()Neutral
#
Signature
findlinestarts(code)

Find the offsets in a byte code which are start of lines in the source.

.get_instructions()Neutral
#
Signature
get_instructions(x, first_line, show_caches, adaptive)

Iterator for the opcodes in methods, functions or code

.main()Neutral
#
Signature
main()

main function.

.pretty_flags()Neutral
#
Signature
pretty_flags(flags)

Return pretty representation of code flags.

Fully-Qualified Names

FQNField
disfqns[0]

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

Import

rule.py
import dis