Skip to main content

Erlang-like atoms in Python 3

Project description

Erlang-like atoms in Python 3

Status: Alpha; this is an experiment.

A tiny utility that lets you refer to often-used strings in your project as imported object names.

Instead of writing:

@app.route('/register', methods=['GET', 'POST'])
def register():
    pass

You could write:

from atum import GET, POST

@app.route('/register', methods=[GET, POST])
def register():
    pass

This might be useful if you use autocompletion. Another benefit is exceptions occur sooner in case of typos, since the interpreter itself validates the imported names. Pay attention when importing, simply tab-to-complete later.

Examples

from atum import machine, human

assert human == human
assert machine == machine
assert human != machine
assert human is human
assert machine is machine
from atum import user_is_awake
from queue import Queue

q = Queue()

q.put(user_is_awake)

assert q.get() == user_is_awake

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

atum-0.1.1.tar.gz (2.1 kB view hashes)

Uploaded Source

Built Distribution

atum-0.1.1-py3-none-any.whl (2.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page