Refactoring: Possible to move method/class/function to another module?

I need to move a function to another module (refactoring). It would be nice if PyCharm could take care of all references to this function and adjust them appropriately in one go. I could not find such an option. If I choose Refactor -> Move... or Copy.., I can only move the whole file.

A workaround is to simply cut the code of the function and paste it into the destination module. However, I need to adjust the references manually or use the help of the inspection.

Is this somehow possible within the refactoring framework or should I initiate a request in YouTrack? Thanks for any help.

2 comments

Hello Volker,

We just finished implementing an initial version of this refactoring. It'll

appear in the next PyCharm 1.5 EAP build.

I need to move a function to another module (refactoring). It would be

nice if PyCharm could take care of all references to this function and

adjust them appropriately in one go. I could not find such an option.

If I choose Refactor -> Move... or Copy.., I can only move the whole

file.

A workaround is to simply cut the code of the function and paste it

into the destination module. However, I need to adjust the references

manually or use the help of the inspection.

Is this somehow possible within the refactoring framework or should I

initiate a request in YouTrack? Thanks for any help.

--

Dmitry Jemerov

Development Lead

JetBrains, Inc.

http://www.jetbrains.com/

"Develop with Pleasure!"

0

Hello Dmitry,

Thanks for the quick answer. Looking forward to testing and using this feature in 1.5.

Keep up the good work!

Volker

0

Please sign in to leave a comment.