On Sun, Jan 25, 2015 at 10:59 AM, Mark Lawrence <breamore...@yahoo.co.uk> wrote: >> You can always "monkey-path" the Fraction class on the fly to add a new >> method to it. I think most would consider this a bad idea, but it does >> work. > > As regards this being a bad idea I'd suggest the latest score is > Practicality 1 Purity 0 :)
Indeed. But there's a huge difference between simple and complex projects. I had a bit of a nightmare trying to figure out what was going on with a project's logging... it looked like the Python logging module, but there was another argument being processed, courtesy of some monkey-patching. Try to keep these changes to small projects, where it's easier to keep everything in your head; or for a temporary bit of debugging, where you just want to do this temporarily and then undo it again when you find the bug. Otherwise, it gets confusing for the subsequent reader. ChrisA -- https://mail.python.org/mailman/listinfo/python-list