自动生成导入,以将一种方法与模块分开
我正在开发一个巨大的 Python 模块,如下所示:
import millions, and, billions, of, modules...
...lots of functions...
def myfunc
...with huge body
...more functions
我想将 myfunc 提取到它自己的模块中。然而,追踪我需要的所有进口实际上是相当乏味的。有没有办法使用 Eclipse 自动执行此操作?我正在使用 Eclipse 3.7.0 和 Aptana Studio 插件(以及 PyDev)。有一个“提取方法”重构工具,但它不这样做。
I'm working on a huge Python module, like this:
import millions, and, billions, of, modules...
...lots of functions...
def myfunc
...with huge body
...more functions
I'd like to extract myfunc to its own module. However, tracking down all the imports I need is actually pretty tedious. Is there a way to do this automatically using Eclipse? I'm using Eclipse 3.7.0 with Aptana Studio plugin (and hence PyDev). There's an "extract method" refactoring tool, but it doesn't do this.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧,也许这比我想象的要容易:
它不是自动的,但相对简单且轻松。
Ok, maybe this is easier than I thought:
It's not automatic, but it's relatively straightforward and painless.