24 Jan
2014
24 Jan
'14
7:10 a.m.
On Fri, Jan 24, 2014 at 4:09 PM, Ethan Furman
On 01/23/2014 08:09 PM, Suresh V. wrote:
Also it would mean that the client code imports from this package. I would like client code to remain exactly as it is (continue to import from its original package) but the behavior is enhanced once this package is imported on startup.
/Something/ has to adjust the pre and post conditions -- if not the client code, then what?
# foo.py: import blah blah.quux() # bar.py: import blah blah.quux.__before__.append(......) import foo With code like that, modifying/rebinding the 'quux' inside bar.py won't affect what happens when foo is imported, ergo monkeypatching the blah module is key. ChrisA