This works perfectly fine, the issue is that when you’re defining the function here, the class itself hasn’t been defined yet so Point isn’t a valid name. You can either quote it - point: 'Point' - which type checkers understand, or use
from __future__ import annotations
at the start of your module to opt into making all annotations strings to avoid it everywhere.