238328 23.04.2012 20:02

You can use the call_check decorator to decorate any function or method that has type annotations for its arguments. The decorator extracts the annotations and asserts that the type of each argument matches its type annotation on every call. It also verifies the return value type (if it was annotated—the return annotation). You need a little finicky code to extract the names of non-keyword arguments from the function's code object because the annotations in the dictionary are unordered; if you just iterate over the items the order may not be the order of the function arguments.

Ну вообще обосраться — проверка типов, при неправильном типе кидается иксэпшн.

Do you really want to delete ?