GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — FrameLocalsProxy (PEP 667) is not registered as a subclass of abc.Mapping · Issue #136492 · python/cpython Closed Labels stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error DescriptionBug reportUpdateTurns out it is correctly registered as a subclass of Mapping of Python 3.13.2 (at least) - which was the original report - but then it should be exposed in Bug description:Although the FrameLocalsProxy object created when retrieving the In practical terms, if I have a function that will support receiving a mapping, and into which I would pass a FrameLocalsProxy, static checkers would fail. this is testable on the repl: import sys from collections.abc import Mapping, MutableMapping FrameLocalsProxy = (lambda: type(sys._getframe().f_locals)() def gen(): yield running_gen = gen() next(running_gen) f_locals = running_gen.gi_frame.f_locals isinstance(f_locals, FrameLocalsProxy) # True isinstance(f_locals, Mapping) # False isinstance(f_locals, MutableMapping) # False Admittedly, it can't conform with Also, otherwise code which wants to test in runtime if an object is a mapping should be able to know that with an isinstance check. I am willing to contribute this change if it is judged correct. CPython versions tested on:3.13 Operating systems tested on:Linux Linked PRsActivity
MetadataMetadataAssigneesLabelsstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error ProjectsMilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |