Files
codegraph/__tests__/fixtures/kernel-parity/torture.py
T
bb1d3093eb fix(extraction): never fabricate an edge from a call-result receiver (#1748)
A member call whose receiver is itself a call — `d.setdefault(k, []).append(v)`,
`make().run()` — used to drop the receiver at extraction time, degrade to the
bare method name, and exact-match any top-level project symbol of that name
(Python and JavaScript/TypeScript). Keep the inner callee encoded as
`<inner>().<method>` in the TS extractor and native kernel; the name-matcher
refuses to guess for that shape (store-accessor exception only). Based on
#1692, rebased onto main after #1746. Fixes #1683.

Co-authored-by: Colby McHenry <colbymchenry@users.noreply.github.com>
2026-09-08 00:23:08 -05:00

59 lines
1.2 KiB
Python

"""Python torture fixture — decorators, self fn-refs, imports, shadowing."""
import os, sys
import os.path as osp
from collections import OrderedDict, defaultdict
from .relative import thing
from mypkg.handlers import target_cb
RETRY_LIMITS = {"a": 1}
API_BASE = "https://example.test"
x = compute(RETRY_LIMITS)
class Service(BaseService, mixins.LoggerMixin):
"""Class docs."""
def __init__(self, registry):
self.registry = registry
register(self.on_event)
queue(target_cb)
@staticmethod
def helper(arg):
return transform(arg)
async def run(self):
cfg = self.registry.lookup("x")
limit = RETRY_LIMITS
obj.method_chain().deep(cfg)
", ".join(cfg)
return await fetch(API_BASE)
def on_event(self):
pass
@app.route("/x")
def view():
def inner():
return API_BASE
return inner()
def shadowed():
API_BASE = "local"
return API_BASE
handlers = {"recv": target_cb}
callbacks = [target_cb, view]
# --- call receivers (#1683) ---------------------------------------------------
def bucket_chains(d, k, v):
d.setdefault(k, []).append(v)
d.items().get(k)
make().run()
(lambda: make)()().run()
obj.make().run().again()