Open hroncok opened 7 years ago
Currently the fix_metaclass fixer uses six.with_metaclass:
fix_metaclass
six.with_metaclass
class Foo(Bar): __metaclass__ = Meta
becomes:
import six class Foo(six.with_metaclass(Meta, Bar)): pass
I believe the @six.add_metaclass() decorator is more readable and the fixer might change it to this instead:
@six.add_metaclass()
import six @six.add_metaclass(Meta) class Foo(Bar): pass
However this may have unwanted side effects (read more about them in the pull request introducing the decorator). What do you think?
(I'm willing to work on this and send a PR, but I want to have a consensus here first not to write code that will end up discarded.)
Currently the
fix_metaclass
fixer usessix.with_metaclass
:becomes:
I believe the
@six.add_metaclass()
decorator is more readable and the fixer might change it to this instead:However this may have unwanted side effects (read more about them in the pull request introducing the decorator). What do you think?
(I'm willing to work on this and send a PR, but I want to have a consensus here first not to write code that will end up discarded.)