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.

It should reload dependants instead of dependencies.

See original GitHub issue

Consider this example:

Module dependant depends on module dependency. (each module prints __name__)

If we reload dependant:

import dependency
reload(dependency)

the dependant module won’t be reloaded. It will print:

dependency
dependant
dependant

but it should print:

dependency
dependant
dependency
dependant

In your blog post http://www.indelible.org/ink/python-reloading/: dependency is A dependant is B

Quoting:

The solution to this problem is to also reload module B. [dependant]

But your code clearly doesn’t do that.

Is there something I misunderstood?

Issue Analytics

  • State:open
  • Created 11 years ago
  • Comments:15 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
Vanuancommented, Nov 15, 2012

I think there’s just a mismatch between your expectation of what this library does and its intention.

According to you, README is lying:

this reloader will reload the requested module and all other modules that are dependent on that module.

There’s no mention of dependencies.

1reaction
micrammcommented, Nov 14, 2012

I think there’s just a mismatch between your expectation of what this library does and its intention. The scenario that the library addresses is that your code imports some module which, in turn, imports a submodule. If you then do some work on the submodule, your code is able to get those changes by running reload(module).

If you could only reload dependents and not dependencies, then you would have to call reload(module.submodule) from your code. But then you have to know exactly what’s been changed. Reloading all the dependencies accounts for arbitrary changes in the submodules.

Being able to reload all the dependants makes sense, but I would call this an extension rather than a bug.

For your os example. there’s a blacklist command that prevents reloader from reloading it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why and How You Should Automate Dependency Updates
A comprehensive look at why dependency management is important and how developers can automate dependency updates.
Read more >
How to Ensure That Your Dependencies Are Up to Date
Following a few tips can help: Wait for a specific reason to update any dependency rather than updating as soon as it's available....
Read more >
How to: Create and remove project dependencies - Visual ...
Learn how you can use Visual Studio to create and remove your project's dependency on code from other projects.
Read more >
Updating Dependencies in a Frontend Project in 6 Easy-ish ...
Instead, I choose one dependency to update and start there. By the time I'm done updating that single dependency, I'll most likely have ......
Read more >
Dependency Pre-Bundling - Vite
Therefore, Vite must convert dependencies that are shipped as CommonJS or UMD into ESM ... Vite will re-run the dep bundling process and...
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