Menu

#570 Use asserts for type inference

open
nobody
None
5
2012-03-06
2012-03-06
Eike Welk
No

In my code there are many lines that check the type of a certain variable
(usually a function argument). Use code like the following to infer the type of
a variable:

assert isinstance(my_var, MyClass)

Discussion