PyCharm debugger chrashes when there is a class named Queue in the project

I have implemented an abstract class called Queue in my project. The PyCharm debugger then no longer works. It obviously tries to load this class for its own purposes. If I rename my class, for example to MyQueue, the debugger works again. I'm using PyCharm 2023.2.3.

0
Hello, 
This is possibly quite a serious issue, but I wasn't able to reproduce it with a minimal example. 
Could you please share a code snippet for reproducing the problem?
0

Here is a code snippet. The PyCharm-Debugger tries ti instatiate this abstract class in its package named adt.

 

# -*- encoding: utf-8 -*-
from abc import ABC, abstractmethod
from typing import TypeVar

T = TypeVar('T')


class QueueError(Exception):
    """
    Allgemeiner Schlangen-Fehler - sollte eigentlich nicht verwendet werden.
    """
    def __str__(self):
        return "Unbekannter Schlangen-Fehler."


class QueueErrorIsFull(QueueError):
    """
    Schlange ist voll.
    """
    def __str__(self):
        return "Schlange ist voll."


class QueueErrorIsEmpty(QueueError):
    """
    Schlange ist leer.
    """
    def __str__(self):
        return "Schlange ist leer."


class Queue(ABC):  # Bei Queue spinnt der Debugger von PyCharm → umbenennen

    @abstractmethod
    def is_empty(self) -> bool:
        """
        Prüfung, ob Schlange leer.

        :return: True, wenn Schlange leer, ansonsten False
        """
        pass

    @abstractmethod
    def enqueue(self, obj: T):
        """
        Einreihen eines Datenelements vom Typ T in die Schlange.

        :param obj: Datenelement vom Typ T
        """
        pass

    @abstractmethod
    def dequeue(self):
        """
        Entfernen des Kopfelements der Schlange.
        """
        pass

    @abstractmethod
    def front(self) -> T:
        """
        Datenelement vom Typ T aus dem Kopf der Schlange liefern.

        :return: Datenelement vom Typ T
        """
        pass

0

The issue is still unreproducible for me. Please create a bug report on YouTrack so we can properly investigate the problem.

0

请先登录再写评论。