Metaclass is used in several places in NVDA code. Python3 changed the syntax of using a metaclass and it is not compatible with python 2.
Py2: syntax
metaclass = xxx
Py3 syntax
class A(metalcass=xxx):
We need "six" module to make metaclass run in Python2 and 3.
There are two tools in that module.
Which one is more suitable?
six.with_metaclass(metaclass, *bases)
or
@six.add_metaclass(metaclass)
Metaclass is used in several places in NVDA code. Python3 changed the syntax of using a metaclass and it is not compatible with python 2.
Py2: syntax
metaclass = xxx
Py3 syntax
class A(metalcass=xxx):
We need "six" module to make metaclass run in Python2 and 3.
There are two tools in that module.
Which one is more suitable?
six.with_metaclass(metaclass, *bases)
or
@six.add_metaclass(metaclass)