MCPcopy Create free account
hub / github.com/getsentry/sentry / _unwrap_copy

Function _unwrap_copy

tools/flake8_plugin.py:368–376  ·  view source on GitHub ↗

Strip `.copy()` / `.dict()` so `request.GET.copy()` still reads as the source.

(node: ast.expr)

Source from the content-addressed store, hash-verified

366
367
368def _unwrap_copy(node: ast.expr) -> ast.expr:
369 """Strip `.copy()` / `.dict()` so `request.GET.copy()` still reads as the source."""
370 while (
371 isinstance(node, ast.Call)
372 and isinstance(node.func, ast.Attribute)
373 and node.func.attr in _COPY_METHODS
374 ):
375 node = node.func.value
376 return node
377
378
379def _declared_elements(value: ast.expr) -> list[ast.expr]:

Callers 1

_isMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected