i can easily override print in micropython when "exec"'ing user provided code:
Code: Select all
def x_print(msg):
print(">>", msg)
exec('print("Hallo")', { "print": x_print })
Code: Select all
>> Hallo
Code: Select all
import time
time.sleep = lambda x: None
Code: Select all
AttributeError: 'module' object has no attribute 'sleep'