Skip to content

detect slots layout conflict in multiple inheritance#3011

Closed
knQzx wants to merge 2 commits intofacebook:mainfrom
knQzx:fix-slots-layout-conflict
Closed

detect slots layout conflict in multiple inheritance#3011
knQzx wants to merge 2 commits intofacebook:mainfrom
knQzx:fix-slots-layout-conflict

Conversation

@knQzx
Copy link
Copy Markdown
Contributor

@knQzx knQzx commented Apr 4, 2026

summary

test plan

fixes #2916
fixes #2917

when two or more base classes define non-empty __slots__, cpython raises
a TypeError at runtime. this adds a check for that during class metadata
computation and flags it as an InvalidInheritance error.

fixes facebook#2916 and facebook#2917
@meta-cla meta-cla Bot added the cla signed label Apr 4, 2026
@github-actions github-actions Bot added the size/m label Apr 4, 2026
Copy link
Copy Markdown
Contributor

@stroxler stroxler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, I'll try to get it merged this week. Thanks for the contribution!

@meta-codesync
Copy link
Copy Markdown
Contributor

meta-codesync Bot commented Apr 6, 2026

@stroxler has imported this pull request. If you are a Meta employee, you can view this in D99692624.

@stroxler stroxler self-assigned this Apr 6, 2026
@github-actions github-actions Bot added size/m and removed size/m labels Apr 6, 2026
Copy link
Copy Markdown
Contributor

@yangdanny97 yangdanny97 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review automatically exported from Phabricator review in Meta.

@meta-codesync
Copy link
Copy Markdown
Contributor

meta-codesync Bot commented Apr 7, 2026

@stroxler merged this pull request in 7ce1a1e.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

__slots__ layout conflict in multiple inheritance __slots__ layout conflict with same slot names

3 participants