Infinite loop in Python console

This code triggers an infinite loop in the Python Console in Pycharm (It prints the numbers 0, 1, 2…). Running this code in “normal” interactive session or executing it in a script does not cause any problems.

class Meta(type):
    def __getattr__(cls, name):
        return Foo()


class MyClass(metaclass=Meta):
    pass


class Foo:
    def __getitem__(self, key):
        print(key)

 

Version: PyCharm 2024.2.4 (Professional Edition)
on a MacBook Air M2

 

0
1 comment
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.
0

Please sign in to leave a comment.