MCPcopy
hub / github.com/nonebot/nonebot2 / _next_field

Method _next_field

nonebot/config.py:133–140  ·  view source on GitHub ↗
(self, field: ModelField | None, key: str)

Source from the content-addressed store, hash-verified

131 return dotenv_vars
132
133 def _next_field(self, field: ModelField | None, key: str) -> ModelField | None:
134 if not field or origin_is_union(get_origin(field.annotation)):
135 return None
136 elif field.annotation and lenient_issubclass(field.annotation, BaseModel):
137 for field in model_fields(field.annotation):
138 if field.name == key:
139 return field
140 return None
141
142 def _explode_env_vars(
143 self,

Callers 1

_explode_env_varsMethod · 0.95

Calls 3

origin_is_unionFunction · 0.90
lenient_issubclassFunction · 0.90
model_fieldsFunction · 0.90

Tested by

no test coverage detected