question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Refactor module imports in all scripts

See original GitHub issue

Requirement

Fix multiple method imports from discussed here, reproduce to all scripts

Pre-requisite

  • Elementary knowledge of Python

Dependencies

None

Description

  • Scripts have many methods being imported from the same module, replace this with importing the module and change references in the code Before fix
from a import a_method
#some code
#use method as
a_method()

After fix

import a
#some code
#use method as
a.a_method()
  • This is essentially a <kbd>beginner</kbd> level issue, labelling <kbd>easy</kbd> to account for possible redundant work in all scripts.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:18 (17 by maintainers)

github_iconTop GitHub Comments

1reaction
Pihu1998commented, Mar 2, 2020

@vishakha-lall As you said, I am waiting for @radhikasethi2011 to raise a PR so that I can collaborate on her work and make suggestions and provide feedback. 😃

0reactions
vishakha-lallcommented, Mar 11, 2020

@asthacs I have assigned this to you. Please track your progress constantly. @radhikasethi2011, you can take a look at other open issues, since she had commented earlier.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Is there an IDE/utility to refactor Python * imports to use ...
Not a perfect solution, but what I usually do is this: Open Pydev; Remove all * imports; Use the optimize imports command (...
Read more >
Python import: Advanced Techniques and Tips
In Python, you use the import keyword to make code in one module available in another. Imports in Python are important for structuring...
Read more >
Avoiding the Fear of Refactoring With Absolute Imports in React
Let's see how to use absolute path aliases to make your imports refactor-friendly in React. Avoiding relative paths and broken links while ...
Read more >
Refactor GAM to be "import"able · Issue #23 - GitHub
I'd like to use some of the GAM logic in separate scripts. GAM already does a lot of the hard work to set...
Read more >
Move package triggers optimize imports?
I'm using 2016.2 (162.1237.1) I have optimize imports disabled. Yet, when I attempt to move a module, all the scripts that import that......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found