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

Allow incompatible overriding of __slots__ #4890

Merged
merged 2 commits into from Apr 13, 2018

Conversation

Projects
None yet
3 participants
@JukkaL
Collaborator

JukkaL commented Apr 12, 2018

__slots__ is magic and there's no need for subclasses to have
compatible definitions.

Allow incompatible overriding of __slots__
`__slots__` is magic and there's no need for subclasses to have
compatible definitions.
@@ -4296,3 +4299,13 @@ class C: pass
@undefined # E: Name 'undefined' is not defined
class D: pass
[case testSlotsCompatibility]

This comment has been minimized.

@JelleZijlstra

JelleZijlstra Apr 12, 2018

Collaborator

Should we test that there is still an error if we set __slots__ to something nonsensical like an int?

This comment has been minimized.

@JukkaL

JukkaL Apr 13, 2018

Collaborator

Added a test case.

@ilevkivskyi

Looks good!

@JukkaL JukkaL merged commit 457bc96 into master Apr 13, 2018

3 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@gvanrossum gvanrossum deleted the slots branch Apr 26, 2018

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