【问题标题】:Typehints for ndb Google Cloud Datastore in PyCharm are missingPyCharm 中 ndb Google Cloud Datastore 的类型提示丢失
【发布时间】:2020-07-31 11:42:54
【问题描述】:

ndb Model 类的实例对象没有类型提示。

例如some_datetime 不显示任何类型提示。类型提示在其他地方也有效。
我是否需要专门为类型提示安装一些东西才能与 ndb 库一起使用?

from google.cloud import ndb

class MyModel(ndb.Model):
    some_datetime = ndb.DateTimeProperty()

    def f(self):
        self.some_datetime # PyCharm does not give type hints for datetime obj
                           # I expect hints like .timestamp, .tzinfo, etc

链接到ndb library

【问题讨论】:

    标签: python-3.x google-cloud-platform pycharm google-cloud-datastore type-hinting


    【解决方案1】:

    我已经能够重现您的问题并且我一直在寻找这个问题,但我在 Google 和 PyCharm 的文档中都没有找到任何东西。

    无论如何,我认为这个问题与 PyCharm 有更多关系,所以你应该考虑在他们的support page 中提交请求。

    【讨论】:

      猜你喜欢
      • 2017-04-13
      • 2015-03-04
      • 1970-01-01
      • 2019-06-08
      • 1970-01-01
      • 2013-12-26
      • 1970-01-01
      • 2016-07-24
      • 2021-10-31
      相关资源
      最近更新 更多