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


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]
Comment actions Permalink
Hi Gary, does this happen inside a function or at a module top level?
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.

Please sign in to leave a comment.