Skip to main content

Callback Properties in Python

Project description

Azure Status Coverage Status

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.0.tar.gz (55.7 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.0-py3-none-any.whl (52.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: echo-0.14.0.tar.gz
  • Upload date:
  • Size: 55.7 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.0.tar.gz
Algorithm Hash digest
SHA256 913f2460c564e516aa590b944da8dfadd9e750d18fe8afa447e33b66013aac06
MD5 98ccd28b7ab7ddbdd953c6234dc0ce49
BLAKE2b-256 9323c57ba1ed23bf296f5dd7a723a72761ede128b067554aad601f9fe66515fc

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: echo-0.14.0-py3-none-any.whl
  • Upload date:
  • Size: 52.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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fb3e048473735ced48dd3aa8bc3535ff65e6ef211eea3bbf3047b40006b36139
MD5 fb5f77c5473fd269921bf81e7b5f1cf2
BLAKE2b-256 3b0714380c39c36a446ab7f3e16847daee9e0256194bd6aee5a39da9f7d3e341

See more details on using hashes here.

Provenance

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