MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / is_tuple

Function is_tuple

tools/python-3.11.9-amd64/Lib/lib2to3/fixer_util.py:158–168  ·  view source on GitHub ↗

Does the node represent a tuple literal?

(node)

Source from the content-addressed store, hash-verified

156###########################################################
157
158def is_tuple(node):
159 """Does the node represent a tuple literal?"""
160 if isinstance(node, Node) and node.children == [LParen(), RParen()]:
161 return True
162 return (isinstance(node, Node)
163 and len(node.children) == 3
164 and isinstance(node.children[0], Leaf)
165 and isinstance(node.children[1], Node)
166 and isinstance(node.children[2], Leaf)
167 and node.children[0].value == "("
168 and node.children[2].value == ")")
169
170def is_list(node):
171 """Does the node represent a list literal?"""

Callers 3

transformMethod · 0.85
transformMethod · 0.85
transformMethod · 0.85

Calls 2

LParenFunction · 0.85
RParenFunction · 0.85

Tested by

no test coverage detected