Skip to main content

<Enter a one-sentence description of this project here.>

Project description

A decorator for adding static variables to a method.

Typical use:

from static_vars import static_vars

@static_vars(counter=0)
def foo():
    foo.counter += 1

foo()
foo()
assert foo.counter==2
foo.counter = 0
foo()
assert foo.counter==1

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

static_vars-0.1.0.tar.gz (2.2 kB view hashes)

Uploaded Source

Built Distribution

static_vars-0.1.0-py3-none-any.whl (2.7 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