use six.with_metaclass for Py2 compat