Skip to main content

A poorly-architected event dispatcher that does magic and lets you do terrible things

Project description

Why you shouldn’t use this

ZPED let’s you do some truly silly stuff with event dispatching. There’s a built-in decorator that will create and execute pre/post execution events on functions, which is pretty cool! Until you realize that your event listeners can arbitrarily modify the execution of your code by raising exceptions. A pre-execution event can completely modify the data sent to the executing function, or even the data sent to other listeners (since they’re executed in serial). The same event can even stop execution entirely and force return a value. A post-execution event can do similar. It’s insane, it’s terrible, it will make your applications /really/ hard to debug.

Why I even wrote this

I’m in the process of writing a static website generator based on Flask, and I needed a good way to let plugins tie into the core system. One of the better days to do this is with event dispatching! So I started writing a simple dispatcher, because using an external library for that seemed silly. Then I thought, “If I were insane and writing a plugin to heavily modify the generator’s internals, but didn’t want to fork the code or monkeypatch… what would I need?” ZPED is the culmination of that, and entirely too much coffee.

Ok, but… I don’t /have/ to use the bad parts of this, right?

No, but power corrupts.

Just tell me how to use it

Look at the tests, I’ll write some docs later.

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

zped-0.1.2.tar.gz (3.3 kB view details)

Uploaded Source

File details

Details for the file zped-0.1.2.tar.gz.

File metadata

  • Download URL: zped-0.1.2.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for zped-0.1.2.tar.gz
Algorithm Hash digest
SHA256 3258df40e81f1ff97b5d982a099c3a65a430f1375b03b5af7f57e8317bef2f21
MD5 1d51175d0b0dc1e42fe83c41ff69d404
BLAKE2b-256 8b5d60819e8b2bce73bbcb02b45430afcf00c92b9a8ba82550f350d3d79ae44e

See more details on using hashes here.

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