diff --git a/mixin/_weakref.py b/mixin/_weakref.py new file mode 100644 index 00000000..05eab2c8 --- /dev/null +++ b/mixin/_weakref.py @@ -0,0 +1,8 @@ +def proxy(object, callback=None): + return object + +class ref(): + def __init__(self, object, callback=None): + self.__object = object + def __call__(self): + return self.__object diff --git a/test/completion/std.py b/test/completion/std.py index 098fb375..fe5ab73b 100644 --- a/test/completion/std.py +++ b/test/completion/std.py @@ -18,3 +18,16 @@ next(re.finditer('a', 'a')).start() #? str() re.sub('a', 'a') + +# ----------------- +# ref +# ----------------- +import weakref + +#? int() +weakref.proxy(1) + +#? weakref.ref +weakref.ref(1) +#? int() +weakref.ref(1)()