[Python] Pylint unnecessary pass statement for abstract method

Discussão em 'Python' iniciado por Stack, Novembro 23, 2024.

  1. Stack

    Stack Membro Participativo

    I have an abstract method which just includes a pass statement, as the method implementation is in another class that inherits from this abstract class. Here is the method:

    @abstractmethod
    def parse_sun_times(self, times_as_strings: Dict[str, str]) -> SunTimes:
    """
    Parses a dictionary of time strings into a SunTimes object.

    Args:
    times_as_strings (Dict[str, str]): A dictionary containing time strings as values and
    sun phases as keys

    Returns:
    SunTimes: An object representing parsed sunrise, sunset, and twilight times.
    """
    pass


    Pylint is giving the warning "unnecessary pass statement". Is there some way I can signify to pylint that this is an abstract method, or do I just have to disable the warning manually?

    Continue reading...

Compartilhe esta Página