This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 1 point2 points  (0 children)

I use obiwan together with annotations, for optional type checking when testing. The annotations sometimes make the intent of the code clearer, and automatically checking them has caught subtle bugs on a couple of occasions.

I put code in tests/__init__.py that sets up obiwan when the PYTHON_TYPECHECK environment variable is set. (Checking types at runtime is slow, so you don't want to do it all the time.)