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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file syntactic-0.1.3.tar.gz.
File metadata
- Download URL: syntactic-0.1.3.tar.gz
- Upload date:
- Size: 5.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.0.0b4 CPython/3.7.3 Linux/4.15.0-72-generic
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
54258eff69206709193df3615fa33a6e2cc0872a0add4fc6b2232e81b9c37c48
|
|
| MD5 |
119ca32293550d14e8aecf180a010313
|
|
| BLAKE2b-256 |
1bbc4f5065843194435a9325daa660d91699095e3ecdeeadbca0e84513c0da08
|
File details
Details for the file syntactic-0.1.3-py3-none-any.whl.
File metadata
- Download URL: syntactic-0.1.3-py3-none-any.whl
- Upload date:
- Size: 5.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.0.0b4 CPython/3.7.3 Linux/4.15.0-72-generic
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
628ced0dc03f6c0580026a0280b42366e9b8fd780923ba51a1aee95bc7702328
|
|
| MD5 |
126a757b65dc455a310f82814c4c1084
|
|
| BLAKE2b-256 |
e5b3cbda5f512cdde76949aa2528d7559f69703a7257ec67887b3887a4c0f9b2
|