Skip to content

Conversation

@cyberpsychoz
Copy link

@cyberpsychoz cyberpsychoz commented Jan 28, 2026

Summary

Adds tests, fixes, and documentation for the Python compiler.

Changes

Tests

  • Add 30 unit tests for Python compiler (test/unit/compilers/python.unit.test.ts)
  • All tests pass: literals, operators, precedence, let expressions, dates

Fixes

  • Fix Windows path handling in fixtures.integration.test.ts
  • Fix Windows CLI invocation in cli.integration.test.ts
  • Make test-python.sh configurable via PYTHON_CMD env variable

Documentation

  • Add PYTHON-COMPILER.md (English)
  • Add PYTHON-COMPILER-RU.md (Russian)
  • Update README.md with Python target info

Test Results

  • Unit tests: 1054/1054 pass
  • Integration tests: 846/846 pass
  • Python fixtures: 44/44 pass

Python support is now fully implemented and tested. Features include:

  • All arithmetic, logical, and comparison operators
  • Let bindings (using walrus operator :=)
  • Lambdas, map/filter/reduce
  • Temporal types (dates, datetimes, ISO8601 durations)
  • Type definitions with schema validation
  • Guards and type selectors
  • Pipe (|>) and alternative (|) operators

44 acceptance tests pass. Requires Python 3.8+ for walrus operator support.

CLI usage:

eloc -e "2 ^ 10" -t python
# => (lambda _: 2 ** 10)

cyberpsychoz and others added 3 commits January 28, 2026 12:40
- Add Python compiler unit tests (30 tests)
- Fix Windows path handling in fixtures test
- Fix Windows CLI invocation in integration tests
- Make test-python.sh configurable via PYTHON_CMD
- Update README with Python documentation
@cyberpsychoz cyberpsychoz changed the title Test python compiler Python Compiler Implementation Jan 28, 2026
@cyberpsychoz cyberpsychoz reopened this Jan 28, 2026
@cyberpsychoz cyberpsychoz changed the title Python Compiler Implementation test: add Python compiler tests, Windows fixes, and documentation Jan 28, 2026
@blambeau
Copy link
Contributor

blambeau commented Jan 29, 2026

@cyberpsychoz looks ok at first glance.

Should we add some doc/example showing how to load a python-generated lambda from another Python program?

What's your own use case ?

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.

2 participants