◐ Shell
clean mode source ↗

gh-146587: fix type slot assignment incase of multiple slots for same name by kumaraditya303 · Pull Request #146593 · python/cpython

@kumaraditya303 kumaraditya303 changed the title gh-146587: add fix type slot assignment incase of multiple slots for same name gh-146587: fix type slot assignment incase of multiple slots for same name

Mar 29, 2026

@sergey-miryanov

@kumaraditya303

Could you please take a look at sergey-miryanov@f26545a? WDYT?

It looks the same as this one except more complicated, you are also checking that if a slot has duplicates then only one of them should be filled isn't it?

I am not sure that the loop is big enough that there would be performance difference.

@sergey-miryanov

Yeah, it looks the same. Except we don’t need to iterate all slotdefs, because we precalculates dup indexes.

@sergey-miryanov

I wrote answer before your edit.

I don’t remember exactly how items in slotdefs, about 70 maybe 94 (edited). For dups we need iterate 2 or 3 items.

@kumaraditya303

Yeah, it looks the same. Except we don’t need to iterate all slotdefs, because we precalculates dup indexes.

Alright, I implemented your suggestion.

@sergey-miryanov

sergey-miryanov

maurycy added a commit to maurycy/cpython that referenced this pull request

Mar 30, 2026

clin1234 pushed a commit to clin1234/cpython that referenced this pull request

Apr 16, 2026

ljfp pushed a commit to ljfp/cpython that referenced this pull request

Apr 25, 2026