PyCharm:无法移动Refactor静态方法

Stu*_*mus 8 python refactoring pycharm python-2.7

(环境:PyCharm 5.0.2,interepreter:与OSX 10.10捆绑在一起的Python 2.7)

嘿伙计,

我一直无法弄清楚如何让PyCharm让我在静态方法上做一个Move Refactor.这支持吗?我找不到任何文件表明它不是.

具体行为

我启动了一个全新的工作区并将其放入文件中.

class MyGreatDemonstratorClass(object):
    @staticmethod
    def some_static_method():
        print "static hey"

    @classmethod
    def some_class_method(cls):
        print "class hey"

    def some_instance_method(self):
        print "instance hey"


def unbound_method():
    print "unbound hey"
Run Code Online (Sandbox Code Playgroud)
  1. 我右键单击some_static_method,将鼠标悬停在"重构"上,单击"移动"
  2. 弹出红色文字说"无法使用所选元素执行重构"(img)
  3. (这同样适用于some_class_methodsome_instance_method,虽然这对我来说很有意义,重构一个绑定的方法是很难的.)
  4. 重复#1 unbound_method,它应该工作.

所以我的问题是

  • 是否在PyCharm中重构了@staticmethod?
  • 如果没有,推荐的方法是什么?绳?