On 13 July 2013 22:16, Dave Angel <da...@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
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to