walrus - Backport Compiler for Assignment Expressions

Write assignment expressions in Python 3.8 flavour, and let walrus worry about back-port issues 🍺

Since PEP 572, Python introduced assignment expressions syntax in version 3.8. For those who wish to use assignment expressions in their code, walrus provides an intelligent, yet imperfect, solution of a backport compiler by replacing assignment expressions syntax with old-fashioned syntax, which guarantees you to always write assignment expressions in Python 3.8 flavour then compile for compatibility later.

Installation

Warning

walrus is currently under reconstruction. It is highly recommended to directly install from the git repo or the pre-release distributions.

Note

walrus only supports Python versions since 3.4 🐍

For macOS users, walrus is available through Homebrew:

brew tap jarryshaw/tap
brew install walrus
# or simply, a one-liner
brew install jarryshaw/tap/walrus

You can also install from PyPI for any OS:

pip install bpc-walrus

Or install the latest version from the Git repository:

git clone https://github.com/pybpc/walrus.git
cd walrus
pip install -e .
# and to update at any time
git pull

Note

Installation from Homebrew will also automatically install the man page and Bash Completion script for you. If you are installing from PyPI or the Git repository, you can install the completion script manually.

Usage

See Usage.

Indices and tables