Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automate import handling for the moved definition list #25

Open
lmmx opened this issue Dec 11, 2020 · 0 comments
Open

Automate import handling for the moved definition list #25

lmmx opened this issue Dec 11, 2020 · 0 comments
Labels
enhancement New feature or request
Projects

Comments

@lmmx
Copy link
Owner

lmmx commented Dec 11, 2020

After moving one or more funcdefs out of the file, I may want to then import them back in, and it'd be nice if this could be handled automatically (and since I'm already rewriting import statements it wouldn't be a big stretch)

  • hello.py
def foo():
    print("foo")

foo()
  • world.py
def bar():
    print("bar")
  • mvdef -m foo hello.py world.py
  • python hello.py should continue to print out "foo",
  • hello.py should become:
from .world import foo

I'm not sure how you'd want to detect whether to use relative import (.world) or absolute package imports, but at least defaulting to relative would be simple and easily corrected...

@lmmx lmmx added the enhancement New feature or request label Dec 11, 2020
@lmmx lmmx added this to To do in mvdef via automation Dec 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
mvdef
To do
Development

No branches or pull requests

1 participant