◐ Shell
clean mode source ↗

Message 391945 - Python tracker

I'm not a big user of the inspect module, but I always thought that its use was so that you could look at a function (or other object) *produced by a 3rd party* and learn something about it.

Asking for the signature is one such operation, and I'd be rather upset if I couldn't inspect the annotation if that 3rd party happened to have added a bad string annotation. especially if I wasn't interested in the annotation part of the signature in the first place. (There's a lot of other useful info to be gleaned from it.)

OTOH I think it's fine for get_annotations() to raise by default if there's a bad annotation.