Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/phohenecker/static-init
A class decorator for invoking static constructors.
https://github.com/phohenecker/static-init
decorators python3
Last synced: about 6 hours ago
JSON representation
A class decorator for invoking static constructors.
- Host: GitHub
- URL: https://github.com/phohenecker/static-init
- Owner: phohenecker
- License: mit
- Created: 2017-11-13T21:38:43.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2017-11-24T18:11:27.000Z (almost 7 years ago)
- Last Synced: 2024-10-12T04:27:46.276Z (27 days ago)
- Topics: decorators, python3
- Language: Python
- Size: 16.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
static-init
===========The module [staticinit](staticinit.py) defines the decorator `@staticinit.init()` for classes, which executes a static
constructor after the annotated class has been created.
By default, the name of the according constructor method is assumed to be `__static_init__`, but an alternative name may
be specified via the keyword arg `init_meth`.
Notice further that the constructor has to be a class method.The following example illustrates how to use this module:
```python
import staticinit@staticinit.init()
class SomeClass(object):@classmethod
def __static_init__(cls):
# do some initialization stuff here...
```Installation
------------This module can be installed from PyPI:
```
pip install staticinit
```