Closed
Description
Bug report
Bug description:
FrameLocalsProxy
should be a mapping. I.e. it should subclass collections.abc.Mapping
and match {}
in a match statement.
from collections.abc import Mapping
import sys
def f():
return sys._getframe().f_locals
proxy = f()
assert(instance(proxy, Mapping))
match proxy:
case {}:
kind = "mapping"
case _:
kind = "other"
assert(kind == "mapping")
CPython versions tested on:
CPython main branch
Operating systems tested on:
Linux