MCPcopy Index your code
hub / github.com/python/cpython / __forwardmethods

Function __forwardmethods

Lib/turtle.py:306–324  ·  view source on GitHub ↗
(fromClass, toClass, toPart, exclude = ())

Source from the content-addressed store, hash-verified

304 'self.%(attribute)s.%(method)s(*args, **kw)')
305
306def __forwardmethods(fromClass, toClass, toPart, exclude = ()):
307 ### MANY CHANGES ###
308 _dict_1 = {}
309 __methodDict(toClass, _dict_1)
310 _dict = {}
311 mfc = __methods(fromClass)
312 for ex in _dict_1.keys():
313 if ex[:1] == '_' or ex[-1:] == '_' or ex in exclude or ex in mfc:
314 pass
315 else:
316 _dict[ex] = _dict_1[ex]
317
318 for method, func in _dict.items():
319 d = {'method': method, 'func': func}
320 if isinstance(toPart, str):
321 execString = \
322 __stringBody % {'method' : method, 'attribute' : toPart}
323 exec(execString, d)
324 setattr(fromClass, method, d[method]) ### NEWU!
325
326
327class ScrolledCanvas(TK.Frame):

Callers 1

turtle.pyFile · 0.85

Calls 4

__methodDictFunction · 0.85
__methodsFunction · 0.85
keysMethod · 0.45
itemsMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…