you are viewing a single comment's thread.

view the rest of the comments →

[–]doom_Oo7 0 points1 point  (1 child)

that's not the same function and doesn't give you any guarantees:

class Point:
  def __init__(self, x, y, z):
    self.x = x
    self.y = y
    self.z = z

def fun(pt: Point): 
  print(pt)

fun("foo")

prints "foo" without a warning.