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

WPS306 seems outdated #1559

Closed
Dreamsorcerer opened this issue Aug 20, 2020 · 4 comments
Closed

WPS306 seems outdated #1559

Dreamsorcerer opened this issue Aug 20, 2020 · 4 comments
Labels
bug Something isn't working documentation Docs related task help wanted Extra attention is needed

Comments

@Dreamsorcerer
Copy link
Contributor

WPS306 requires inheriting from object. This seems like a rather dated approach for Python 3 code.

The doc has a 'See also' link which further proves the point and contradicts the wemake rule, saying that it's preferable without object, and lists the other approach as 'Ancient'.

@Dreamsorcerer Dreamsorcerer added the bug Something isn't working label Aug 20, 2020
@orsinium
Copy link
Collaborator

I'm even in favor of making the opposite rule: "don't inherit a class from object, it's no use in Python 3"

@sobolevn
Copy link
Member

sobolevn commented Aug 24, 2020

For some reason Python developers are incorrectly interpreting this rule. (Maybe because of the damaging past)

The idea of this rule is not about python2 vs python3. It is about consistency of class A(object): vs class B(A):
We always have our base class in ().

Consistent: class A(object): vs class B(A):
Inconsistent: class A: vs class B(A):

That's it. Please, don't search any historic issues here.

@Dreamsorcerer
Copy link
Contributor Author

OK, but that's not clear from the text. I expect the "See also" to help confirm the reasoning, but here it directly contradicts the rule.

@sobolevn sobolevn reopened this Aug 24, 2020
@sobolevn sobolevn added documentation Docs related task help wanted Extra attention is needed labels Aug 24, 2020
@sobolevn
Copy link
Member

Yes, docs can be misleading and should be fixed! Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Docs related task help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants