Skip to main content

Callback Properties in Python

Project description

CI Status Coverage Status PyPI Version

echo: Callback Properties in Python

Echo is a small library for attaching callback functions to property state changes. For example:

class Switch(object):
    state = CallbackProperty('off')

def report_change(state):
    print 'the switch is %s' % state

s = Switch()
add_callback(s, 'state', report_change)

s.state = 'on'  # prints 'the switch is on'

CalllbackProperties can also be built using decorators

class Switch(object):

      @callback_property
      def state(self):
        return self._state

      @state.setter
      def state(self, value):
          if value not in ['on', 'off']:
              raise ValueError("invalid setting")
          self._state = value

Full documentation is avilable here

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

echo-0.14.1.tar.gz (56.5 kB view details)

Uploaded Source

Built Distribution

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

echo-0.14.1-py3-none-any.whl (53.8 kB view details)

Uploaded Python 3

File details

Details for the file echo-0.14.1.tar.gz.

File metadata

  • Download URL: echo-0.14.1.tar.gz
  • Upload date:
  • Size: 56.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for echo-0.14.1.tar.gz
Algorithm Hash digest
SHA256 10c730018fb764ce867e78f5c353a3b15b249a49398894e734b4a487a12a34b9
MD5 806ee725c8e84c23ff8d00381d6fa1f2
BLAKE2b-256 532911010b6d6eea97e892b582d086c1cb9ded99d688eae47e6cba35e004ff7f

See more details on using hashes here.

Provenance

The following attestation bundles were made for echo-0.14.1.tar.gz:

Publisher: ci_workflows.yml on glue-viz/echo

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

File details

Details for the file echo-0.14.1-py3-none-any.whl.

File metadata

  • Download URL: echo-0.14.1-py3-none-any.whl
  • Upload date:
  • Size: 53.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for echo-0.14.1-py3-none-any.whl
Algorithm Hash digest
SHA256 95c99479c1b92e3aaa59c5434919e5aabc0c9b05932e021cd44018b4eaf05257
MD5 d4c1818d4de7ab1c282000f06c9c6b9d
BLAKE2b-256 97b0b24ad29876e3a0ffeb275f6e3b8952d7510df1938abccadaad5dc727363e

See more details on using hashes here.

Provenance

The following attestation bundles were made for echo-0.14.1-py3-none-any.whl:

Publisher: ci_workflows.yml on glue-viz/echo

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