Hello,
I understood that you are trying to do run-time check for provided annotations with return and parameters. I also understood that all types annotations must be followed recursively:
Also you want two additional functions being checked inside the body of main one(Check_Annotation) as to add flexibility:
Check_All_OK - that checks if data type satisfies indicated condition
Check_Any_OK - that allows to put different data types
('a',{[1]:1}) != (str,{[]:str})
('a',{[1]:1}) == (str,{[]:Check_Any_OK(Check_All_OK(str, lambda x : len(x)<=3),int)})
('a',{[1]:'All'}) == (str,{[]:Check_Any_OK(Check_All_OK(str, lambda x : len(x)<=3),int)})
I expect it to be the library size no bigger then 1000 lines at the end and about same size test(as secondary effect of work).