QUERY · ISSUE
micropython dict has not __contains__ method
py-core
Hi Team,
Today I check contains method of dict, but not found. MicroPython v1.16. I open file objdict.c, and also not found. Is it missed?
Thanks,
Cuong.
CANDIDATE · ISSUE
problems with __contains__ magic method
The magic method __contains__ seems to be defined in the micropython code, but it doesn't work. I have been trying to hunt down the problem and have failed to pinpoint it so far. The bug is easily reproducible:
class problem:
def __contains__(self, key):
return True
test = problem()
if True in test:
print("__contains__ works")