MCPcopy Index your code
hub / github.com/python/cpython / negate

Function negate

Tools/clinic/libclinic/cpp.py:15–21  ·  view source on GitHub ↗

Returns a CPP conditional that is the opposite of the conditional passed in.

(condition: str)

Source from the content-addressed store, hash-verified

13TokenStack = list[TokenAndCondition]
14
15def negate(condition: str) -> str:
16 """
17 Returns a CPP conditional that is the opposite of the conditional passed in.
18 """
19 if condition.startswith('!'):
20 return condition[1:]
21 return "!" + condition
22
23
24is_a_simple_defined = re.compile(r'^defined\s*\(\s*[A-Za-z0-9_]+\s*\)$').match

Callers 1

writelineMethod · 0.85

Calls 1

startswithMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…