use six for type checking