Skip to main content

Works just like @property for classes, except deleters don't work (and are perhaps impossible).

Inspired by https://stackoverflow.com/a/39542816/43839

Example

import clsprop

class Full:
    _name = 'fool'

    @clsprop
    def name(cls):
        return cls._name

    @name.setter
    def name(cls, name):
        cls._name = name

    # Unfortunately, the deleter never gets called
    @name.deleter
    def name(cls, name):
        raise ValueError('Cannot delete name')

assert Full.name == 'fool'

Full.name = 'foll'
assert Full.name == 'foll'

del Full.name  # oh, well

API Documentation

Metadata

Release files for clsprop 1.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for clsprop 1.5.0
File Size Uploaded
clsprop-1.5.0.tar.gz 19.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for clsprop 1.5.0
File Interpreter ABI Platform
clsprop-1.5.0-py3-none-any.whl Python 3 none any Details

Total release size: 21.2 kB

Release files / clsprop-1.5.0.tar.gz

Download URL clsprop-1.5.0.tar.gz
Size 19.0 kB
Tags Source
SHA-256 checksum
How to use checksums
7b8aa165c0d1424c1a05c653ac22b3566752de18e483f9f3f6c1add1b13b7d56
BLAKE2b-256 checksum
How to use checksums
987902e8f28002f10562208bf66710810c589b24ce00137efc9d2e3efe6c36fe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / clsprop-1.5.0-py3-none-any.whl

Download URL clsprop-1.5.0-py3-none-any.whl
Size 2.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ea5b52bfff6a57f79adf58ee1de53ede2d6ea3521c34b07a9e23c3e8aef6b21f
BLAKE2b-256 checksum
How to use checksums
d73f6fc27d8b367437fc715a28bd2b21e1cef7fe827a5ca612e7cd78d0cf2191
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

This release

1.5.0 This release

2 release files

1.4.0

2 release files

1.3.1

2 release files

1.3.0

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page