Help us shape the future of Go! Take the 2026 Go Developer Survey

python

package
v0.5.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 29, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package python implements a Python extractor backed by tree-sitter.

Coverage:

  • SymbolFile / SymbolStruct (class) / SymbolFunction / SymbolMethod / SymbolVar (module-level assignments)
  • EdgeContains, EdgeHasMethod, EdgeImports
  • EdgeCalls (v0.4+, F-B): best-effort, AST-only resolution

Call resolution rules (v0.4):

  • bare `foo()` where `foo` is a module-level definition in the same file → CALLS edge.
  • `self.method()` inside a method of class `C` where `C.method` exists in the same file → CALLS edge.
  • All other call shapes (cross-module, dynamic dispatch, *args unpacking, decorators-as-calls) are dropped silently.

Known false-positive class: a local variable that shadows a module-level name will still be resolved against the module-level symbol. We don't track per-scope shadowing in v0.4. Documented in FINDINGS.md F-B "fixed" entry.

IMPLEMENTS / RETURNS / ACCEPTS edges remain unsupported (Python's dynamic typing means this requires a real type checker).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Extractor

type Extractor struct{}

func New

func New() *Extractor

func (*Extractor) Extensions

func (e *Extractor) Extensions() []string

func (*Extractor) Extract

func (e *Extractor) Extract(_ context.Context, _ string, _ []byte) ([]core.Symbol, []core.Edge, error)

func (*Extractor) ExtractRepo

func (e *Extractor) ExtractRepo(ctx context.Context, root string) ([]core.Symbol, []core.Edge, error)

func (*Extractor) FQN

func (e *Extractor) FQN(_ context.Context, file string, scope []string, name string) core.FQN

func (*Extractor) Language

func (e *Extractor) Language() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL