On 4/25/21 3:08 PM, Shreyan Avigyan wrote: > Thanks for clarifying. And I agree with you. Not writing checking code will > make the function more flexible. > > Thanking you, > With Regards
My experiance is that the type annotaions let my IDE warn me of wrong parameters, or give me hints as to what type it wants. I generally don't need to explicitly test the type, as if it is of the wrong type (at least a wrong type of duck) then it will throw an error when I do something it doesn't know how to do it. Thus, unless the exact type of exception is important (and it usually isn't) there is no need to test and throw a specific type of error. -- Richard Damon _______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/KDTCACLLCAYG5Z6WXK2TCY2NAHX7JPEO/ Code of Conduct: http://python.org/psf/codeofconduct/