Selfie
Loading...
Searching...
No Matches
pytest_selfie.plugin._keydefaultdict Class Reference
Inheritance diagram for pytest_selfie.plugin._keydefaultdict:

Public Member Functions

 __missing__ (self, key)
 

Detailed Description

A special defaultdict that passes the key to the default_factory.

Definition at line 139 of file plugin.py.

Member Function Documentation

◆ __missing__()

pytest_selfie.plugin._keydefaultdict.__missing__ (   self,
  key 
)

Definition at line 142 of file plugin.py.

142 def __missing__(self, key):
143 if self.default_factory is None:
144 raise KeyError(key)
145 else:
146 ret = self[key] = self.default_factory(key) # type: ignore
147 return ret
148
149

The documentation for this class was generated from the following file: