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

Class Descriptor

Lib/test/test_descr.py:5009–5015  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5007 # issue 4230
5008
5009 class Descriptor(object):
5010 counter = 0
5011 def __get__(self, obj, objtype=None):
5012 def getter(name):
5013 self.counter += 1
5014 raise AttributeError(name)
5015 return getter
5016
5017 descr = Descriptor()
5018 class A(object):

Callers 1

test_getattr_hooksMethod · 0.70

Calls

no outgoing calls

Tested by 1

test_getattr_hooksMethod · 0.56

Used in the wild real call sites across dependent graphs

searching dependent graphs…