A module metaclass, to make your classes into modules.
Project description
ModuleMeta
Python modules are hard. modulemeta
attempts to make them easier to write in the interpreter.
Basic Usage
>>> import modulemeta as module
>>> class Wat(metaclass=module):
... _ermelon = 5
...
... def ermelon():
... return _ermelon
...
>>> Wat.ermelon()
5
>>> Wat
<module 'Wat'>
>>> module
<class 'module.Module'>
Inheritance
Shockingly, modules cannot be inherited from, therefore they are treated as metaclasses:
import modulemeta as module
class Wat(metaclass=module):
pass
class Wat2(metaclass=Wat):
pass
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
modulemeta-0.1.0a2.tar.gz
(2.7 kB
view hashes)
Built Distribution
Close
Hashes for modulemeta-0.1.0a2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1b76330e58a5f92bc24ea561f7fe9e83e96020f06ae1bbf6233a55bfa8aec58d |
|
MD5 | d2b4a24247b8ae9aa90dc5fb21aed501 |
|
BLAKE2b-256 | 5088ee6b17ffd7612cb96d30a103e8c8f867f7290348e1548981cc2e06e58ead |