Overview

docs Documentation Status
tests
Travis-CI Build Status
Coverage Status
package
PyPI Package latest release PyPI Wheel Supported versions Supported implementations
Commits since latest release

https://syntactic.readthedocs.io/

Customizable syntax for Python.

Possible uses

  • Experimenting with possible language features.
  • Boilerplate reduction.

Examples

Unicode lambdas

from __syntax__ import unicode_lambdas

increment = λx: x + 1

is equivalent to

increment = lambda x: x + 1

SQL template literals

Embedded sql:

from __syntax__ import sql_literals

engine.query(sql`SELECT author FROM books WHERE name = {book} AND author = {author}`)

is equivalent to:

engine.query('SELECT author FROM books WHERE name = ? AND author = ?', [book, author])

Limitations

The example transformers are written in a fragile way. They are intended only as inspiration rather than production-ready transformers. If you want to add some production-ready ones, pull-requests are welcome.