Skip to content

Commit 51c6e18

Browse files
authored
adds comment about the transition from context to ctx
1 parent a316b6f commit 51c6e18

File tree

1 file changed

+3
-0
lines changed
  • packages/google-cloud-ndb/google/cloud/ndb

1 file changed

+3
-0
lines changed

packages/google-cloud-ndb/google/cloud/ndb/context.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,9 @@ def __new__(
319319
legacy_data=legacy_data,
320320
)
321321

322+
# 'context' is dynamically composed at runtime and may include methods
323+
# from multiple sources that Mypy cannot statically resolve here.
324+
# We cast to `Any` to access the extended policy interface.
322325
ctx = cast(Any, context)
323326
ctx.set_cache_policy(cache_policy)
324327
ctx.set_global_cache_policy(global_cache_policy)

0 commit comments

Comments
 (0)