mirror of
https://github.com/github/codeql.git
synced 2025-12-18 01:33:15 +01:00
14 lines
419 B
Python
14 lines
419 B
Python
|
|
#This is prone to strange side effects and race conditions.
|
|
class MutatingDescriptor(object):
|
|
|
|
def __init__(self, func):
|
|
self.my_func = func
|
|
|
|
def __get__(self, obj, obj_type):
|
|
#Modified state is visible to all instances of C that might call "show".
|
|
self.my_obj = obj
|
|
return self
|
|
|
|
def __call__(self, *args):
|
|
return self.my_func(self.my_obj, *args) |