【发布时间】: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