MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / _weak_or_strong_ref

Function _weak_or_strong_ref

lib/matplotlib/cbook.py:137–144  ·  view source on GitHub ↗

Return a `WeakMethod` wrapping *func* if possible, else a `_StrongRef`.

(func, callback)

Source from the content-addressed store, hash-verified

135
136
137def _weak_or_strong_ref(func, callback):
138 """
139 Return a `WeakMethod` wrapping *func* if possible, else a `_StrongRef`.
140 """
141 try:
142 return weakref.WeakMethod(func, callback)
143 except TypeError:
144 return _StrongRef(func)
145
146
147class _UnhashDict:

Callers 3

__setstate__Method · 0.85
connectMethod · 0.85
disconnectMethod · 0.85

Calls 1

_StrongRefClass · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…