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.15.0.tar.gz (57.2 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.15.0-py3-none-any.whl (54.5 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for echo-0.15.0.tar.gz
Algorithm Hash digest
SHA256 59fcc543f25879e8e9b1f0df264d7c65ab8952118854d0f416885d1d2a6a0956
MD5 d658695c4ce8c36d79d87dfc163ca9ef
BLAKE2b-256 348ff6a81136b89f3e8c2c2497fc071ca5fcadd7276c1c853cc525556d3527b2

See more details on using hashes here.

Provenance

The following attestation bundles were made for echo-0.15.0.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.15.0-py3-none-any.whl.

File metadata

  • Download URL: echo-0.15.0-py3-none-any.whl
  • Upload date:
  • Size: 54.5 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.15.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4b5f196dc76f29956981021d720ea11536c1cfb263cd9a6efb13f98820b1daa0
MD5 1bc125cfd9b4830ac55d135e444a9f09
BLAKE2b-256 24680ab167e98191b220e20fafb0bec3b48afec36ad77569ad253cf6c6f6ae12

See more details on using hashes here.

Provenance

The following attestation bundles were made for echo-0.15.0-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