Custom syntax for Python.
Project description
docs |
|
---|---|
tests |
|
package |
https://syntactic.readthedocs.io/
Customizable syntax for Python.
Possible uses
Experimenting with possible language features.
Boilerplate reduction.
Examples
Unicode lambdas
from __syntax__ import unicode_lambda
func = λx: x + 1
is equivalent to
func = 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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
syntactic-0.1.2.tar.gz
(5.4 kB
view hashes)
Built Distribution
Close
Hashes for syntactic-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c9d921916a2b634a4862073fb7df95f97ba63d16e1070b9588928eef6d14bf4b |
|
MD5 | 6552dfb851775d0dcb184f013f4b9159 |
|
BLAKE2b-256 | e99807ec217922956396c48be900d97129da5a7b8e294c4d2ee2d3aec5c47440 |