weakref: Add basic stub function to aid in porting.

Signed-off-by: Andrew Leech <andrew@alelec.net>
pull/529/head
Andrew Leech 2022-09-07 08:30:40 +10:00 zatwierdzone przez Andrew Leech
rodzic 50ed36fbeb
commit afb5e250a1
2 zmienionych plików z 14 dodań i 0 usunięć

Wyświetl plik

@ -0,0 +1,3 @@
metadata(version="0.0.1")
module("weakref.py")

Wyświetl plik

@ -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