def println(text: str):
try:
print(text)
if not type(text) == str:
raise TypeError(f"argument \"text\" should be type \"str\". not type \"{type(text)}\"".)
except TypeError as err:
print(err)
This works fine and it says:
argument "text" should be type "str". not type "<class 'int'>".
but I don't see what line it's coming from. It's coming from line 4 and it doesn't say the line where the error is coming from. This makes it hard and frustrating to debug errors.