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 — inspect.getframeinfo and traceback build every preceding co_positions() tuple · Issue #161799 · python/cpython Open Labels pendingThe issue will be closed if no feedback is providedThe issue will be closed if no feedback is providedperformancePerformance or resource usagePerformance or resource usagestdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancementA feature request or enhancement DescriptionBug report
next(itertools.islice(code.co_positions(), instruction_index // 2, None))
On 3.11 and on current import inspect import timeit def make(n): src = "def f():\n" + " x = 1\n" * n + " return inspect.stack(0)\n" ns = {"inspect": inspect} exec(src, ns) return ns["f"] small, large = make(10), make(2500) print("small", timeit.timeit(small, number=2000) / 2000) print("large", timeit.timeit(large, number=200) / 200) The byte offset passed in is A direct lookup for real code objects removes the per-instruction tuple. Objects that only implement CPython versions tested on:3.11, CPython main branch Operating systems tested on:No response Linked PRsActivity
MetadataMetadataAssigneesLabelspendingThe issue will be closed if no feedback is providedThe issue will be closed if no feedback is providedperformancePerformance or resource usagePerformance or resource usagestdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancementA feature request or enhancement 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. |