问题
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
回答1:
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
来源:https://stackoverflow.com/questions/42140876/theres-invalid-syntax-in-pub-py