python optional type checking