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

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.