2
class Foo():
    def __init__(self):
        self.bar_ref = self.bar  # Allocation occurs here
        self.x = 0.1

    def bar(self, _):
        self.x *= 1.2

@wim said

The dotted attribute access self.bar is an invocation of descriptor __get__, creating a bound method.

How do I get Pycharm to show __get__ being executed when debugging?

Bob
  • 4,220
  • 6
  • 29
  • 89

1 Answers1

3

The relevant __get__ method is implemented in C; it's func_descr_get in Objects/funcobject.c. PyCharm does not support stepping into code written in C.

I believe you could step into this code with a Python debug build and the Cython GDB extension, or even with a Python debug build and regular GDB if you're okay with seeing everything from the raw C-level perspective, but you can't do it in PyCharm.

user2357112
  • 235,058
  • 25
  • 372
  • 444