Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use @six.add_metaclass() decorator instead of six.with_metaclass()? #153

Open
hroncok opened this issue Apr 28, 2017 · 0 comments
Open

Use @six.add_metaclass() decorator instead of six.with_metaclass()? #153

hroncok opened this issue Apr 28, 2017 · 0 comments

Comments

@hroncok
Copy link

hroncok commented Apr 28, 2017

Currently the fix_metaclass fixer uses 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:

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.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant