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

Method take_action

Lib/test/test_optparse.py:1072–1078  ·  view source on GitHub ↗
(self, action, dest, opt, value, values, parser)

Source from the content-addressed store, hash-verified

1070 TYPED_ACTIONS = Option.TYPED_ACTIONS + ("extend",)
1071
1072 def take_action(self, action, dest, opt, value, values, parser):
1073 if action == "extend":
1074 lvalue = value.split(",")
1075 values.ensure_value(dest, []).extend(lvalue)
1076 else:
1077 Option.take_action(self, action, dest, opt, parser, value,
1078 values)
1079
1080 def test_extend_add_action(self):
1081 self.assertParseOK(["-afoo,bar", "--apple=blah"],

Callers

nothing calls this directly

Calls 3

ensure_valueMethod · 0.80
splitMethod · 0.45
extendMethod · 0.45

Tested by

no test coverage detected