Skip to main content

PyPI Build Status Coverage Status

A simple implementation of the observer pattern.

import observer
# Create a subject and list the events it might fire
foo = observer.Subject('bar', 'baz')

# Add a listener
def foo_bar_listener(*args):
   print("heard 'bar'", args)

foo('bar', foo_bar_listener)

# fire events
foo.fire('bar', 1, 2, 3)
# -> heard 'bar' (1, 2, 3)

# Trying to listen to an unregistered event throws an error
foo('snorble', lambda: None)
# -> AssertionError: snorble is not a valid event for this subject

# Same with trying to fire an unregistered event
foo.fire('snorble')
# -> AssertionError: snorble is not a valid event for this subject

Metadata

Release files for observer.simple 1.0.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 observer.simple 1.0.0
File Size Uploaded Provenance
observer.simple-1.0.0.tar.gz 1.9 kB Without provenance Details

Release files / observer.simple-1.0.0.tar.gz

Download URL observer.simple-1.0.0.tar.gz
Size 1.9 kB
Tags Source
SHA-256 checksum
How to use checksums
6f61cb8840051bf507707cb68cd4869d38c8cd6dfa890f9c13dbbae65006c4c5
BLAKE2b-256 checksum
How to use checksums
de21212a6f5866aa49d8c4ff98708e714dee3f1fcc6dbed0ed617ce3f1fb3963
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for observer.simple 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.0 This release

1 release file No provenance

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