3

The followed method is defined in the pubsub.py which is a python file in the site-package pubsub. When I try to use this, the pycharm tells me this is invalid syntax with an arrow pointing to '->'. I don't why and I have installed the pypubsub.

def getDefaultPublisher() -> Publisher:
    """
    Get the Publisher instance created by default when this module
    is imported. See the module doc for details about this instance.
    """
    return _publisher
Oliver
  • 27,510
  • 9
  • 72
  • 103
T. Qin
  • 31
  • 3

1 Answers1

4

You have a Python version mismatch. This version of PyPubSub needs Python3. Last version for Python2 is PyPubSub 3.3.0

pip install PyPubSub==3.3.0