This repository has been archived by the owner. It is now read-only.
Adds a threading operator to Python.
Switch branches/tags
Nothing to show
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore chore: initial commit Aug 10, 2018
LICENSE chore: add missing LICENSE file Aug 12, 2018
README.md chore: initial commit Aug 10, 2018
pyproject.lock chore: initial commit Aug 10, 2018
pyproject.toml chore: bump version Aug 10, 2018
setup.cfg chore: initial commit Aug 10, 2018
test_threadop.py chore: initial commit Aug 10, 2018
threadop.py fix: drop stray print Aug 10, 2018

README.md

threadop

Adds a threading operator to Python. This is stupid and you probably shouldn't use it.

Limitations:

  • The right-hand side must be a function call.
  • Requires access to functions' source code. Meaning this won't work in the interpreter.

Installation

pip install threadop

Usage

import operator

from threadop import enable_threadop


@enable_threadop
def example():
    # The below is equivalent to
    # print(operator.mul(operator.add(42, 15), 2))
    42 | operator.add(15) | operator.mul(2) | print()

example()

License

threadop is licensed under the 3-Clause BSD license. Please see LICENSE for licensing details.