mirror of
https://github.com/micropython/micropython.git
synced 2026-04-25 18:30:23 +02:00
c91d09a00d
Signed-off-by: Damien George <damien@micropython.org>
15 lines
339 B
Python
15 lines
339 B
Python
# Test weakref.ref() functionality that doesn't require gc.collect().
|
|
|
|
try:
|
|
import weakref
|
|
except ImportError:
|
|
print("SKIP")
|
|
raise SystemExit
|
|
|
|
# Cannot reference non-heap objects.
|
|
for value in (None, False, True, Ellipsis, 0, "", ()):
|
|
try:
|
|
weakref.ref(value)
|
|
except TypeError:
|
|
print(value, "TypeError")
|