MCPcopy Create free account
hub / github.com/tox-dev/filelock / _collects_classes

Function _collects_classes

tasks/capabilities.py:103–118  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

101
102
103def _collects_classes() -> bool:
104 # GraalPy can collect a plain class while retaining one instantiated through a custom metaclass.
105 class ProbeMeta(type):
106 def __call__(cls: type[_T]) -> _T:
107 return type.__call__(cls)
108
109 def build() -> type:
110 class Probe(metaclass=ProbeMeta):
111 pass
112
113 Probe()
114 return Probe
115
116 reference: Final[weakref.ReferenceType[type]] = weakref.ref(build())
117 gc.collect()
118 return reference() is None
119
120
121def _preserves_context_thrown_into_a_generator() -> bool:

Callers 1

capabilities.pyFile · 0.85

Calls 1

buildFunction · 0.70

Tested by

no test coverage detected