How to: Extract Method

Everytime I select a block of code and choose Refactor This > Extract > Method, the pop up window arrives with "nothing to show" in the parameter field. Consider the following program:

a = 1
b = 2
c = a + b

print(c)


I select the line c = a + b, and choose Refactor This > Extract > Method.  I expected the popup box parameters field to include at least a and b, but instead:  "nothing to show".  How is this supposed to work?

[PyCharm 4.04 on OS X 10.9.5]
2 comments
Comment actions Permalink
Hi Gary, does this happen inside a function or at a module top level?
0
Comment actions Permalink
Module top layer.   

I did figure out that it works as expected for class methods.  I guess that's why it's called Extract *Method*.   :)

All is well, thanks.
0

Please sign in to leave a comment.