Skip to content

Conversation

@ThanhNguyxn
Copy link

Summary

Adds Python language support to 99, addressing #58.

Changes

  • lua/99/language/python.lua: Language config with log_item function using Python's f-string debug format (print(f"{var=}"))
  • queries/python/99-function.scm: Treesitter queries for function_definition, lambda, and block body captures
  • lua/99/init.lua: Added "python" to the languages array

Implementation Details

Following the existing pattern from other language implementations (Go, Ruby, Elixir, etc.):

  1. Treesitter node types (verified from tree-sitter-python grammar):

    • function_definition - covers both sync and async functions
    • lambda - lambda expressions
    • block - function body
  2. Log format: Uses Python 3.8+ f-string debug format {var=} which outputs both variable name and value

Closes #58

- Add lua/99/language/python.lua with log_item using f-string debug format
- Add queries/python/99-function.scm for function_definition and lambda
- Register python in languages array

Closes ThePrimeagen#58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support Python

1 participant