相关疑难解决方法(0)

在函数docstring中记录`tuple`返回类型,用于PyCharm类型提示

我如何记录函数返回的tuple方式,使PyCharm能够将其用于类型提示?

举例:

def fetch_abbrev_customer_info(customer_id):
  """Pulls abbreviated customer data from the database for the Customer
       with the specified PK value.

       :type customer_id:int The ID of the Customer record to fetch.

       :rtype:???
  """
  ... magic happens here ...

  return customer_obj.fullname, customer_obj.status #, etc.
Run Code Online (Sandbox Code Playgroud)

python docstring pycharm

33
推荐指数
1
解决办法
1万
查看次数

标签 统计

docstring ×1

pycharm ×1

python ×1