[Python] Static typing python problem(ide does not see the class?) [duplicate]

Discussão em 'Python' iniciado por Stack, Dezembro 19, 2024.

  1. Stack

    Stack Membro Participativo

    I write in VS Code and it seems like the IDE does not see the custom class. May I ask for any sugestions why?

    class Point:
    def __init__(self,x,y):
    self.x=x
    self.y=y
    def show(self):
    print(f"{self.x},{self.y}")
    def move(self,vx,vy):
    self.x+=vx
    self.y+=vy

    def calc_dist(self,point2:point):
    print(((self.x-point2.x)**2+(self.y-point2.y)**2)**0.5)


    p1=Point(3,4)
    p2=Point(2,5)

    p1.calc_dist(p2)


    I have tried do add __string__ method and change the name of the second argument/class name but it didn't helped.

    Continue reading...

Compartilhe esta Página