Type safety/annotation in fast ai library

What is the effect of the typed signature in the fast ai library? E.g.

Is it to make functions/methods actually strongly typed, or is it more like type annotation?

1 Like

It’s just for type annotation, to help the reader understand what the function takes and returns.


Got it.

@sgugger since I know you’ve been actively developing the fast ai library, I was curious to know whether you’ve found the lack of strict type safety to be a hinderance in maintaining and developing further this code base given that it has reached a decent level of complexity at this point. Another way to put it is, how much of your dev/maintenance work could be prevented if Python was strongly typed?

It’s not really been a problem, no. Bugs I see are rarely related to types so I don’t think Python being strongly typed would help us much.