Method: flask.ctx._AppCtxGlobals.setdefault
Calls: 14, Exceptions: 0, Paths: 1Back
Path 1: 14 calls (1.0)
'seen' (12) 'bar' (2)
[] (12) 'the cake is a lie' (1) 'hello world' (1)
'the cake is a lie' (2) [] (2) ['app_1'] (2) ['app_1', 'app_2'] (2) ['app_1', 'app_2', 'parent_1'] (2) ['app_1', 'app_2', 'parent_1', 'parent_2'] (2) ...
1def setdefault(self, name: str, default: t.Any = None) -> t.Any:
2 """Get the value of an attribute if it is present, otherwise
3 set and return a default value. Like :meth:`dict.setdefault`.
4
5 :param name: Name of attribute to get.
6 :param default: Value to set and return if the attribute is not
7 present.
8
9 .. versionadded:: 0.11
10 """
11 return self.__dict__.setdefault(name, default)