Code
Hub
Workspaces
Connect
Indexed graphs
Engine
MCP
copy
hub
/
github.com/cool-RR/PySnooper
/ needs_parentheses
Function
needs_parentheses
pysnooper/variables.py:13–17 ·
view source on GitHub ↗
(source)
Source
from the content-addressed store, hash-verified
11
12
13
def
needs_parentheses(source):
14
def
code(s):
15
return
compile(s,
'<variable>'
,
'eval'
).co_code
16
17
return
code(
'{}.x'
.format(source)) != code(
'({}).x'
.format(source))
18
19
20
class
BaseVariable(pycompat.ABC):
Callers
2
test_needs_parentheses
Function · 0.90
__init__
Method · 0.85
Calls
1
code
Function · 0.85
Tested by
1
test_needs_parentheses
Function · 0.72