Skip to main content

A modern object model that uses __slots__

Project description

Slots Class

A modern, efficient object model using __slots__.

Reap the performance benefits of slots-based objects while avoiding some of python's problematic dynamic behaviors.

Installation

pip install slots-class

Usage

Slots are assigned to the class statically at load time.

>>> from slots_class import SlotsClass

>>> class MyObject(SlotsClass):
...     def __init__(self, x):
...         self.x = x
...         self.y = 10
...
...     def set_z(self, value):
...         self._z = value

>>> MyObject.__slots__
('_z', 'x', 'y')

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

slots_class-0.1.0a2.tar.gz (10.3 kB view details)

Uploaded Source

Built Distribution

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

slots_class-0.1.0a2-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

Details for the file slots_class-0.1.0a2.tar.gz.

File metadata

  • Download URL: slots_class-0.1.0a2.tar.gz
  • Upload date:
  • Size: 10.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for slots_class-0.1.0a2.tar.gz
Algorithm Hash digest
SHA256 b160566870eb513b4633b7985d9becb55df199839d75adfd4ca5270b16cc09d5
MD5 3c9d543314c455a0fc7758ec03bf4895
BLAKE2b-256 2dfcedc711a4a480d2216016e14421072d9255ddf20a7429b2d9ffa32d08821a

See more details on using hashes here.

Provenance

The following attestation bundles were made for slots_class-0.1.0a2.tar.gz:

Publisher: python-publish.yml on mkzeender/slots-class

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file slots_class-0.1.0a2-py3-none-any.whl.

File metadata

  • Download URL: slots_class-0.1.0a2-py3-none-any.whl
  • Upload date:
  • Size: 7.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for slots_class-0.1.0a2-py3-none-any.whl
Algorithm Hash digest
SHA256 0cacd1f70d156f84fd8aec69777fdd8466c73d14c8fdc593712964fbe4838bf3
MD5 ed3d2eafabb206a9bdd84b8ecb3dd740
BLAKE2b-256 b177f66e7932f96f86683184c1cceabd809aade4f4f290ca67d14347669ecc81

See more details on using hashes here.

Provenance

The following attestation bundles were made for slots_class-0.1.0a2-py3-none-any.whl:

Publisher: python-publish.yml on mkzeender/slots-class

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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