MCPcopy
hub / github.com/fastapi/fastapi / DefaultPlaceholder

Class DefaultPlaceholder

fastapi/datastructures.py:153–168  ·  view source on GitHub ↗

You shouldn't use this class directly. It's used internally to recognize when a default value has been overwritten, even if the overridden default value was truthy.

Source from the content-addressed store, hash-verified

151
152
153class DefaultPlaceholder:
154 """
155 You shouldn't use this class directly.
156
157 It's used internally to recognize when a default value has been overwritten, even
158 if the overridden default value was truthy.
159 """
160
161 def __init__(self, value: Any):
162 self.value = value
163
164 def __bool__(self) -> bool:
165 return bool(self.value)
166
167 def __eq__(self, o: object) -> bool:
168 return isinstance(o, DefaultPlaceholder) and o.value == self.value
169
170
171DefaultType = TypeVar("DefaultType")

Callers 1

DefaultFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…