Python DocStrings& Pydev的 [英] Python DocStrings & Pydev

查看:90
本文介绍了Python DocStrings& Pydev的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经把Pydev开始运行了,几乎都运行得很好。但是,我在docstrings中遇到麻烦。



比方说我有一个如下功能:



$ _ code> def _get_logging_statement(self):
返回一个容易读取的字符串,它将日志文件中的项目干净地分隔开
result =\\ \
\\\
#============================================ =
result + =\\\
#%-80s#(self)
result = +\\\
\\\
#============= =============================
return result

假设我已经覆盖了repr来格式化该字符串。



当我将鼠标悬停在这在Eclipse中它显示了完整的docstring的意图,但是在docstring下面是实现。有没有办法仅显示文档列表?

解决方案

目前看起来不像。在这个问题上Google Googled,最高的结果指向我这个 Pydev用户发布




5月3日星期一,2010年5:45,Janosch Peters写道:





当我悬停在一个功能或类,我得到一个工具提示,显示函数/类的
整个定义不仅仅是docstring(如我所要的
)。



这是预期的行为吗?我认为这将会更有用,如果只有
显示了docstring的内容。



目前预计。请输入一个功能请求,使
只显示一个选项。



干杯,



Fabio


查看Pydev错误/功能跟踪器,并没有找到此特定问题。您可能需要在Pydev功能请求跟踪器中输入,并查看是否可以在那里获得帮助。


I've gotten Pydev up and running, and almost all is working well. However I'm having some trouble with docstrings.

Let's say for instance I have a function such as the following:

def _get_logging_statement(self):
    """Returns an easy to read string which separates items in the log file cleanly"""
    result = "\n\n#============================================="
    result += "\n#   %-80s#"(self)
    result =+ "\n\n#============================================"
    return result

Assume I've overridden repr to format that string properly as well.

When I hover over this in Eclipse it's showing me the full docstring as intended, however below the docstring is the implementation. Is there a way to show only the docstring?

解决方案

Doesn't look like it currently. Googled around for this issue and the top result pointed me to this Pydev-users post:

On Mon, May 3, 2010 at 5:45 AM, Janosch Peters wrote:

Hi,

when I hover over a function or class, I get a tooltip showing the whole definition of the function/class not only the docstring (as I would expect).

Is this expected behaviour? I think it would be more useful, if only the content of the docstring is shown.

It's currently expected. Please enter a feature request to make showing just the docstring an option.

Cheers,

Fabio

Looked around the Pydev bug/feature tracker and didn't find this specific issue entered. You might want to enter it in the Pydev feature request tracker and see if you can get help there.

这篇关于Python DocStrings& Pydev的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆