There's invalid syntax in pub.py

旧巷老猫 提交于 2019-12-23 16:17:03

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!