Method: flask.json.tag.TaggedJSONSerializer.tag
Calls: 639, Exceptions: 0, Paths: 2Back
Path 1: 541 calls (0.85)
{} (452) dict (10) {'testing': 42} (7) Markup (6) list (6) (1, 2, 3) (5) ('message', 'Hello World') (4) ('error', 'Hello World') (4) tuple (4) bytes (...
{} (452) dict (31) {'testing': 42} (7) list (6) {' m': 'Testing'} (4) {'_permanent': True, 'foo': 3} (3) {'test': 'test'} (3) {'value': '42'}...
1def tag(self, value: t.Any) -> dict[str, t.Any]:
2 """Convert a value to a tagged representation if necessary."""
3 for tag in self.order:
4 if tag.check(value):
5 return tag.tag(value)
6
7 return value
Path 2: 98 calls (0.15)
42 (13) True (11) 1 (11) 3 (10) 2 (9) 'Hello World' (8) False (7) 'message' (4) 'error' (4) 'warning' (4)
42 (13) True (11) 1 (11) 3 (10) 2 (9) 'Hello World' (8) False (7) 'message' (4) 'error' (4) 'warning' (4)
1def tag(self, value: t.Any) -> dict[str, t.Any]:
2 """Convert a value to a tagged representation if necessary."""
3 for tag in self.order:
4 if tag.check(value):
5 return tag.tag(value)
6
7 return value