We should also have a function to "normalize" topics (like os.normpath)
normtopic('prefix1.foo..bar.suffix1')
should return 'prefix1.foo.bar.suffix1'
normtopic('prefix1.foo.bar.suffix1.')
should return 'prefix1.foo.bar.suffix1'
normtopic('.prefix1.foo.bar.suffix1.')
should return 'prefix1.foo.bar.suffix1'
topics should be normalized before being joined
About version of pypubsub
I found this version to read code using Google an pydoc
but I think you should put somewhere in pypubsub website
a link to a source control explorer.
but no HTTP link to read the code
After several minutes I found this link
I think you should put it in
I also notice that you use '.' in your code
maybe you should define a variable
topic_sep = '.'
in pub.py
and use pub.topic_sep