Python PubSub Website

Site Contents

Pubsub Recipes

This section discusses various pubsub “recipes”, ie techniques, suggested practices, patterns, etc.


There are two supported APIs available in pubsub:

  • default (v3): a powerful API that supports two messaging protocols; developed mostly after pubsub was factored out of wxPython.
  • v1: version 1, the original API developed when pubsub was still one module, part of wxPython. The pubsub package includes the module that was originally wx.lib.pubsub, almost verbatim.

The section Upgrade from v1 may be helpful to application developers who wish to migrate an application from using the v1 API to using the more powerful v3 API.

The section Convert Arg1 to Kwargs may be helpful in migrating an application based on the ‘arg1’ protocol to the more rigorous ‘kwargs’ protocol, both available only in v3 API.


Write this section

Avoid using the arg1 messaging protocol. The kwargs protocol, the default, is more expressive, and makes it easier to document your topic message data.

Design Patterns

Write this section