Problem with stepping in PyCharm's debugger

Hi everyone :) My question is simple. I have this code

class PiggyBank:
    def __init__(self, coins):
        self.coins = coins

    def __repr__(self):
        return f'PiggyBank({self.coins})'

    def __add__(self, other):
        if isinstance(other, int):
            return PiggyBank(self.coins + other)
        elif isinstance(other, PiggyBank):
            return PiggyBank(self.coins + other.coins)
        return NotImplemented

    def __radd__(self, other):
        return self.__add__(other)

banks = [PiggyBank(10), PiggyBank(20), PiggyBank(30)]

print(sum(banks))

I put a breakpoint here banks = [PiggyBank(10), PiggyBank(20), PiggyBank(30)], then I run debugger and click on the step into button. The debugger jumps to  self.coins = coins which is correct, but when I click on the step into button again, debugger does not return to the breakpoint(banks = [PiggyBank(10), PiggyBank(20), PiggyBank(30)]. Instead it remains at the same line just showing different values and when the instances of PyggyBank class are over, then it goes to the next line of code print(sum(banks)).  On other words: I want the debug to work like this(https://youtu.be/TQfHeQYViv0) but it works like this(https://youtu.be/CulU_gzpTnU). 

I tried to:
Restore PyCharm to the default settings

Clear the cache

Reinstall PyCharm

Install other version of PyCharm

Install other version of Python

but nothing helps.

OS Info:


PyCharm Info:

 

Python Info:

1
2 comments
Hi,
Please try upgrading IDE to the latest version, disabling all non-bundled plugins (**Settings | Plugins**, click the cog icon -> Disable All Downloaded Plugins) and check if the problem persists.
If the problem remains unresolved, we would like to investigate it properly. Please create an issue on YouTrack (https://youtrack.jetbrains.com/newIssue) regarding this problem. Attach relevant logs (Help | Collect Logs and Diagnostic Data), screenshots, precise steps for reproducing the issue and a runnable code/project sample if needed.
For urgent inquiries, please use Help | Contact Support in the IDE.
1

Thanks, the bug seems fixed in version 2025.1.2

0

Please sign in to leave a comment.