2 ms·
> Because our enhanced Session class now enables retries by default, we don't even need to instantiate it directly. modshim's AST rewriting ensures that interna
by theptip 1y ago
> Because our enhanced Session class now enables retries by default, we don't even need to instantiate it directly. modshim's AST rewriting ensures that internal references within the requests module are updated. This means convenience functions like requests.get() will automatically use our enhanced Session class
This seems to explicitly handle the case you are interested in - automatically updating library-internal references to the lower to instead use the upper?
- o11c 1y agoThat's talking about internal imports (and static - as much as python supports - ones at that), not external ones. If A is my application, B is buggy, and C is some other library, consider: # A.py monkeypatch_B() import C # C.py B = __import__('B') # B.py bugs()
- joouha 1y agoIt should in theory be possible to mount the new virtual package over the lower module - but I don't think works currently (I'll have to test this). Doing this would make modifications available globally like you describe.