Python decorator to turn a function into a variable definition
vardef: contained and organized variable definition
vardef is a simple idea for declaring variables in multiple statements in a contained and organized fashion.
A simple Python decorator built with Heart and designed for Humans
Why to use vardef
Organization: using a vardef function allows all necessary code to define and initialize a variable to be logically separated from the outer scope. This makes it clear what code is relevant to the rest of the scope and what code is only there to assist with initialization. Also, in this way, auxiliary code is avoided being exposed to be imported or messed up by external agents.
Conciseness: a vardef function is a syntax sugar to avoid the need to declare a function which will only be called once to define a variable. With the decorator your code gets concise and also avoids exposing the initializer function.
For further information on how to use the decorator check out our docs!
First beta release
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.