Skip to main content

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

>>> from modulemeta import Module
>>> class Wat(metaclass=Module):
...   _ermelon = 5
...
...   def ermelon():  # type: ignore[misc]
...     return _ermelon
...
>>> Wat.ermelon()
5
>>> Wat
<module 'Wat'>

Inheritance

Shockingly, modules cannot be inherited from, therefore they are treated as metaclasses:

from modulemeta import Module


class Wat(metaclass=Module):
  pass


class Wat2(metaclass=Wat):  # type: ignore[misc]
  pass

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

modulemeta-0.2.0a2.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

modulemeta-0.2.0a2-py3-none-any.whl (3.3 kB view details)

Uploaded Python 3

File details

Details for the file modulemeta-0.2.0a2.tar.gz.

File metadata

  • Download URL: modulemeta-0.2.0a2.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.10.4

File hashes

Hashes for modulemeta-0.2.0a2.tar.gz
Algorithm Hash digest
SHA256 804362dd3ca30882ff8fd30acb1deda3dabc022713885913088c17c337b0c334
MD5 5aa5098dabab13aba93217f197d4d0a1
BLAKE2b-256 6f0a5fc076eb8a42065e910d11a0c8748ed022e9f693999f30ca2841c8017900

See more details on using hashes here.

File details

Details for the file modulemeta-0.2.0a2-py3-none-any.whl.

File metadata

  • Download URL: modulemeta-0.2.0a2-py3-none-any.whl
  • Upload date:
  • Size: 3.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.10.4

File hashes

Hashes for modulemeta-0.2.0a2-py3-none-any.whl
Algorithm Hash digest
SHA256 20ec1cd4c86c3e2eaffa2e3626dd4ad6e00ae1dec49619cc2f6937b318ac26b1
MD5 aad89562aacca0604e4d19a29228d81d
BLAKE2b-256 ab58b508db1004bc5d97cd8be22ea80025bf7ecf8416cdeb3789ccbab1c9d8ae

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page