Skip to content

Python3: incompatible metaclass syntax #8652

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)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions