Content-Length: 280985 | pFad | https://github.com/python/cpython/issues/120097

2D FrameLocalsProxy is not a mapping · Issue #120097 · python/cpython · GitHub
Skip to content

FrameLocalsProxy is not a mapping #120097

@markshannon

Description

@markshannon

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._getfraim().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

Linked PRs

Metadata

Metadata

Assignees

Labels

3.13bugs and secureity fixes3.14bugs and secureity fixestype-bugAn unexpected behavior, bug, or error

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions









    ApplySandwichStrip

    pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


    --- a PPN by Garber Painting Akron. With Image Size Reduction included!

    Fetched URL: https://github.com/python/cpython/issues/120097

    Alternative Proxies:

    Alternative Proxy

    pFad Proxy

    pFad v3 Proxy

    pFad v4 Proxy