diff --git a/python-stdlib/weakref/manifest.py b/python-stdlib/weakref/manifest.py new file mode 100644 index 000000000..dff719314 --- /dev/null +++ b/python-stdlib/weakref/manifest.py @@ -0,0 +1,3 @@ +metadata(version="0.0.1") + +module("weakref.py") diff --git a/python-stdlib/weakref/weakref.py b/python-stdlib/weakref/weakref.py new file mode 100644 index 000000000..a6e15c21c --- /dev/null +++ b/python-stdlib/weakref/weakref.py @@ -0,0 +1,11 @@ +""" +# weakref +https://docs.python.org/3/library/weakref.html + +Micropython does not have support for weakref in the VM, so currently this is a simple stub +module that directly assigns the object reference to simplify porting of other libraries. +""" + + +def ref(obj): + return lambda: obj