Tuesday, 30 November 2021

Automatically Update Python source code (imports)

We are refactoring our code base.

Old:

from a.b import foo_method

New:

from b.d import bar_method

Both methods (foo_method() and bar_method()) are the same. It just changed the name an the package.

Since above example is just one example of many ways a method can be imported, I don't think a simple regular expression can help here.

How to refactor the importing of a module with a command line tool?

A lot of source code lines need to be changed, so that an IDE does not help here.



from Automatically Update Python source code (imports)

No comments:

Post a Comment