It should reload dependants instead of dependencies.
See original GitHub issueConsider 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:
- Created 11 years ago
- Comments:15 (2 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
According to you, README is lying:
There’s no mention of dependencies.
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 asubmodule
. If you then do some work on thesubmodule
, your code is able to get those changes by runningreload(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.