TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Show HN: zodiac, a new approach to monkey patching in python

39 pointsby colinmarcabout 13 years ago

4 comments

davvidabout 13 years ago
On a related note, Michael Foord's `mock.py` was recently added to the python stdlib.<p><a href="http://www.voidspace.org.uk/python/mock/mock.html" rel="nofollow">http://www.voidspace.org.uk/python/mock/mock.html</a>
yyytabout 13 years ago
I can't see how this is different from mock.py. Mock can also do temporary patching:<p>with patch('path.to.object') as my_mock: my_mock.method.return_value = ...<p>also you can patch a module/class with a function.
halayliabout 13 years ago
I'd avoid monkey patching, it can confuse the programmer as to which module is being used. In a small program it's not a big deal but in large systems it can become an issue.
评论 #3808271 未加载
评论 #3808777 未加载
评论 #3808902 未加载
devyabout 13 years ago
Can we say this is very un-pythonic?