mirror of
https://github.com/PrefectHQ/fastmcp.git
synced 2026-08-22 21:44:18 +02:00
Set type adapter parent depth to 3
This commit is contained in:
parent
4f4f27a3d2
commit
f507fca384
1 changed files with 4 additions and 1 deletions
|
|
@ -38,8 +38,11 @@ def get_cached_typeadapter(cls: T) -> TypeAdapter[T]:
|
|||
create them once in a global scope and reuse them as often as possible.
|
||||
However, this isn't feasible for user-generated functions. Instead, we use a
|
||||
cache to minimize the cost of creating them as much as possible.
|
||||
|
||||
The _parent_depth is set to 3 to look at an additional frame, since this
|
||||
function is in its own scope.
|
||||
"""
|
||||
return TypeAdapter(cls)
|
||||
return TypeAdapter(cls, _parent_depth=3)
|
||||
|
||||
|
||||
def issubclass_safe(cls: type, base: type) -> bool:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue