Organize code better with namespaces
Project description
What is this?
This is a very simple python tool for creating namespaces. It tries to solve the problem that there is no elegant way to create singleton classes or nested namespaces in python.
How do I use this?
pip install simple_namespace
from simple_namespace import namespace
@namespace
def MyNamespace():
my_value = 10
def my_function(arg1):
return 99
return locals()
# prints 10
print(MyNamespace.my_value)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
simple_namespace-1.0.0.tar.gz
(1.8 kB
view hashes)
Built Distribution
Close
Hashes for simple_namespace-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | abbcb832ee44a6fbf4c0fa654388ad90d11297ab71b9d3d7bc4e2e882e57173f |
|
MD5 | db80dedd338567c545d884f0844318f2 |
|
BLAKE2b-256 | bcd56e19f6464e76ce710106aa222500c82198b0a74113ab96dd68285afd8fd2 |