Skip to content

Python3: incompatible metaclass syntax #8652

@larry801

Description

@larry801

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)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions