pydantic 2.14.1
- Source
- https://github.com/pydantic/pydantic
- Artifact scanned
pydantic-2.14.1-py3-none-any.whl- Compared with
pydantic-2.14.0-py3-none-any.whl(0 signals introduced since)- Files
- 105 scanned, 6 skipped (binary, oversized, or unrecognised)
- Signals
- 0 critical · 0 warn · 8 info
- Scan time
- 7.7 s
- LLM review
- Reviewed by claude-haiku-5-5 (Anthropic): 8 of 8 warn and critical signals; 8 demoted to info.
- Disclude version
- 4.3.0
- Scanned (UTC)
- 2026-10-22 23:51
Signals
Ordered by severity, then signals introduced in this release. Hidden characters are shown as ⟨U+…⟩.
-
= = returnlikely benign Lazy submodule loader that imports a package attribute by name and caches it in module globals.Reasoning
The snippet is the standard lazy-import pattern: a module-level __getattr__ imports a submodule by name with import_module and caches it in globals(). The target name comes from the module's own attribute lookup, with no decoding, network access, or process spawning, so it is ordinary library code.
-
=likely benign Walks the call stack via inspect.currentframe to extract source text for a class's docs.Reasoning
inspect.currentframe is used to walk the call stack while extracting class source documentation. This is a known way to locate a class's definition for docstring extraction, and the snippet shows nothing beyond reading frames.
-
=likely benign Fetches a caller frame at a given depth to resolve generic-model namespaces.Reasoning
sys._getframe(depth) is used to find the caller's frame so generic parametrization can resolve the parent namespace. It is wrapped in a ValueError guard that raises a clear error, which is typical of library internals.
-
""" frame = sys._getframe(parent_depth) if frame.f_code.co_name.startswith('<generic parameters of'):likely benign Reads a parent frame's code name to detect generic-parameter scopes during type resolution.Reasoning
sys._getframe(parent_depth) reads the caller's code name to detect generic-parameter scopes in typing helpers. It only inspects frame metadata and does not execute anything.
-
= =likely benign Reads the caller's module name from its frame globals to set a default __module__.Reasoning
sys._getframe(1) reads the caller's f_globals['__name__'] to default __module__ when a class is created without one. This is a standard idiom for setting a class's module and has no side effects.
-
= # Because `TypeAdapter` is generic, explicitly parametrizing the class resultslikely benign Fetches the parent frame to resolve namespace for TypeAdapter type evaluation.Reasoning
sys._getframe(self._parent_depth) is used to locate the parent frame for namespace resolution in TypeAdapter. The code only checks the frame's globals for a typing module name, which is consistent with pydantic's documented parent-namespace handling.
-
# and so we skip the globalns = get_module_ns_of(typ) call that would normally happen = . =likely benign Reads the caller's f_globals at a computed depth to build a type namespace resolver.Reasoning
sys._getframe with a clamped depth reads f_globals to build a namespace resolver for the adapter. This is read-only frame access used for forward-reference resolution.
-
=likely benign Fetches the caller's frame in the v1 generics module to resolve the parent namespace.Reasoning
sys._getframe(2) fetches the caller frame to determine the parent namespace for generic model creation in the v1 compatibility layer. The same ValueError guard is present, and the snippet shows no execution or network use.
Reproduce This Scan
Run disclude locally to verify. These commands scan the published file; the "new in this release" marks come from comparing it with the previous release's file, which they don't repeat. Add --format sarif for SARIF output. Add --llm (with an API key in the environment) to include the LLM review.
|