MCPcopy
hub / github.com/python-attrs/attrs / decide_callable_or_boolean

Function decide_callable_or_boolean

src/attr/_make.py:1265–1273  ·  view source on GitHub ↗

Decide whether a key function is used.

(value)

Source from the content-addressed store, hash-verified

1263 raise ValueError(msg)
1264
1265 def decide_callable_or_boolean(value):
1266 """
1267 Decide whether a key function is used.
1268 """
1269 if callable(value):
1270 value, key = True, value
1271 else:
1272 key = None
1273 return value, key
1274
1275 # cmp takes precedence due to bw-compatibility.
1276 if cmp is not None:

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected