[Python] Spyder showing syntactically incorrect autocompletes

Discussão em 'Python' iniciado por Stack, Junho 15, 2025.

  1. Stack

    Stack Membro Participativo

    I have a class Polygon(self, name, sides, sidelength=1, color= None). I want to define a subclass Square of Polygon.

    I think the code for that is

    class Square(Polygon):
    def __init__(....)
    super().__init__(...)


    If I am also correct, I can't pass in the attributes within the same line when I am creating the subclass: i.e., the following would be wrong:

    class Square(Polygon("Square", 4)):


    But then why does Spyder do this autocomplete?

    [​IMG]

    When I click on Polygon, I see this:

    [​IMG]

    It is quite annoying to delete those extra terms (name, sides) every time.

    Continue reading...

Compartilhe esta Página