MCPcopy Index your code
hub / github.com/nonebot/nonebot2 / construct

Method construct

nonebot/compat.py:171–175  ·  view source on GitHub ↗

Construct a ModelField from given infos.

(
            cls, name: str, annotation: Any, field_info: FieldInfo | None = None
        )

Source from the content-addressed store, hash-verified

169
170 @classmethod
171 def construct(
172 cls, name: str, annotation: Any, field_info: FieldInfo | None = None
173 ) -> Self:
174 """Construct a ModelField from given infos."""
175 return cls._construct(name, annotation, field_info or FieldInfo())
176
177 def __hash__(self) -> int:
178 # Each ModelField is unique for our purposes,

Callers 4

_check_paramMethod · 0.80
_check_paramMethod · 0.80
_check_paramMethod · 0.80
parse_paramsMethod · 0.80

Calls 2

FieldInfoClass · 0.85
_constructMethod · 0.45

Tested by

no test coverage detected