MCPcopy Create free account
hub / github.com/cloudpipe/cloudpickle / check_annotations

Method check_annotations

tests/cloudpickle_test.py:2673–2679  ·  view source on GitHub ↗
(obj, expected_type, expected_type_str)

Source from the content-addressed store, hash-verified

2671 MyClass.__annotations__ = {"attribute": type_}
2672
2673 def check_annotations(obj, expected_type, expected_type_str):
2674 # On Python 3.14, it's no longer possible to access class
2675 # annotations from an instance, so use type().
2676 assert type(obj).__annotations__["attribute"] == expected_type
2677 assert obj.method.__annotations__["arg"] == expected_type
2678 assert obj.method.__annotations__["return"] == expected_type
2679 return "ok"
2680
2681 obj = MyClass()
2682 assert check_annotations(obj, type_, "type_") == "ok"

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected