You can remove methods (functions) from the namespace at run time. This is called a monkey patch. Example in an interactive session:
Python 2.7.6 (default, Mar 22 2014, 22:59:56) [GCC 4.8.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import time >>> time.sleep(2) >>> del time.sleep >>> time.sleep(2) Traceback (most recent call last): File "<stdin>", line 1, in <module> AttributeError: 'module' object has no attribute 'sleep'
But back to your original question: I believe that on the platform you are using, they could replace several standard library modules (including the time module) using custom versions. Therefore, you should ask them how you can achieve the desired delay without resorting to lively waiting.
source share