Luke Lee

Software Engineer

Web + Desktop + Science

Fork me on Github

Python can be evil

Disclaimer: This is just for fun, don't use this code!

I read an article the other day about how to make sure a function is only called once. I'm not entirely sure of a real use-case for this sort of thing. However, it was an interesting brain teaser.

The comments of the article even suggested a funny trick to play, call a random function instead of the real one after 1 call. So, I decided to implement something to do this just to test my metaprogramming skills:

Go checkout out the new Github Gist interface and try it out!

Published: 12-14-2012 14:52:00