[Tutor] A slight bug in IDLE

Jim Mooney cybervigilante at gmail.com
Sun Jul 14 10:27:21 CEST 2013


On 13 July 2013 22:16, Dave Angel <davea at davea.name> wrote:

That's monkey-patching.  You're reaching inside the module and modifying
> it.


That's interesting. I saw that phrase and wondered what it was. Now I know
;')  Actually, I did refactor the numbers program into disparate functions.
That's why I started using main(), so I could import it and just use the
functions. That test would have been impossible if everything was still
mashed up. In fact, once I refactored, I saw how easy it would be to test
like that. But callbacks look interesting. I'll have to try them.

Except using a callback would mean editing the inputter module, which I am
pretending is some module code I'm importing but don't want to mess with.
So I just import it and do the so-called monkey patch without actually
editing the module. My thought was I could do quick tests and dummy  inputs
without changing the module itself.

Jim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20130714/4aa392d7/attachment.html>


More information about the Tutor mailing list