top | item 44091110 (no title) benhoyt | 9 months ago Yeah, I use this sometimes too (even though Python makes "monkey patching" easy). However, note that it's simpler and clearer to use a default value for the argument: def do_foo(sleep=time.sleep): for _ in range(10): sleep(1) discuss order hn newest No comments yet.
No comments yet.