MCPcopy Create free account
hub / github.com/ActiveState/code / setdefault

Method setdefault

recipes/Python/577524_Python_Sessions/recipe-577524.py:156–162  ·  view source on GitHub ↗
(self, item, default=None)

Source from the content-addressed store, hash-verified

154 return self.cookie.output()
155
156 def setdefault(self, item, default=None):
157 if not self.started:
158 raise NotStarted("Session must be started")
159 if not self.isset(item):
160 self[item] = default
161
162 return self[item]
163
164 def set_expires(self, days):
165 """Sets the expiration of the cookie"""

Callers 4

NamedSequencesFunction · 0.45
setMethod · 0.45
__new__Method · 0.45
build_indexFunction · 0.45

Calls 2

issetMethod · 0.95
NotStartedClass · 0.85

Tested by

no test coverage detected