Not a show/patch stopper in my book, since we control the whole data flow here, but for future reference I think isinstance() is preferrable to type() when checking types in Python