import inspect class yallfucked: def __iadd__(self, byhowmuch): parent_locals = inspect.currentframe().f_back.f_locals for name, value in parent_locals.items(): if isinstance(value, int): parent_locals[name] += byhowmuch yall = yallfucked() a, b = 1, 2 print(a, b) # 1 2 yall += 4 print(a, b) # 5 6
https://files.mastodon.social/media_attachments/files/113/908/756/527/764/062/original/712235642f8aaeca.png