Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

gh-146587: fix type slot assignment incase of multiple slots for same name#146593

Merged
kumaraditya303 merged 6 commits into
python:mainpython/cpython:mainfrom
kumaraditya303:fix-gh-146587kumaraditya303/cpython:fix-gh-146587Copy head branch name to clipboard
Mar 30, 2026
Merged

gh-146587: fix type slot assignment incase of multiple slots for same name#146593
kumaraditya303 merged 6 commits into
python:mainpython/cpython:mainfrom
kumaraditya303:fix-gh-146587kumaraditya303/cpython:fix-gh-146587Copy head branch name to clipboard

Conversation

@kumaraditya303

@kumaraditya303 kumaraditya303 commented Mar 29, 2026

Copy link
Copy Markdown
Contributor

@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
@kumaraditya303 kumaraditya303 added the interpreter-core (Objects, Python, Grammar, and Parser dirs) label Mar 29, 2026
@kumaraditya303 kumaraditya303 requested a review from vstinner March 29, 2026 11:43
@sergey-miryanov

Copy link
Copy Markdown
Contributor

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

@kumaraditya303

kumaraditya303 commented Mar 29, 2026

Copy link
Copy Markdown
Contributor Author

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

Copy link
Copy Markdown
Contributor

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

@sergey-miryanov

sergey-miryanov commented Mar 29, 2026

Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown
Contributor Author

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

Copy link
Copy Markdown
Contributor

Thanks!

@kumaraditya303 kumaraditya303 merged commit 8e10bd7 into python:main Mar 30, 2026
51 checks passed
@kumaraditya303 kumaraditya303 deleted the fix-gh-146587 branch March 30, 2026 12:37
maurycy added a commit to maurycy/cpython that referenced this pull request Mar 30, 2026
…ktor

* upstream/main: (119 commits)
  pythongh-144270: Make SubElement parent and tag positional-only (pythonGH-144845)
  pythongh-146558: JIT optimize dict access for objects with known hash (python#146559)
  pythongh-139922: always run MSVC 64-bit tail-calling CI (pythonGH-146570)
  pythongh-126835: Fix _PY_IS_SMALL_INT() macro (python#146631)
  pythongh-146587: fix type slot assignment incase of multiple slots for same name (python#146593)
  pythongh-138122: Add differential flame graph (python#145785)
  pythongh-146416: Emscripten: Improve standard stream handling in node_entry.mjs (python#146417)
  pythongh-146444: Don't package as part of iOS 'build hosts' target (python#146628)
  pythongh-138850: Add --disable-epoll to configure (pythonGH-145768)
  pythongh-146444: Make Platforms/Apple/ compatible with Python 3.9 (python#146624)
  pythongh-138577: Fix keyboard shortcuts in getpass with echo_char (python#141597)
  pythongh-146556: Fix infinite loop in annotationlib.get_annotations() on circular __wrapped__ (python#146557)
  pythongh-146579: _zstd: Fix decompression options dict error message (python#146577)
  pythongh-146083: Upgrade bundled Expat to 2.7.5 (python#146085)
  pythongh-146080: fix a crash in SNI callbacks when the SSL object is gone (python#146573)
  pythongh-146090: fix memory management of internal `sqlite3` callback contexts (python#146569)
  pythongh-145876: Do not mask KeyErrors raised during dictionary unpacking in call (pythonGH-146472)
  pythongh-146004: fix test_args_from_interpreter_flags on windows (python#146580)
  pythongh-139003: Use frozenset for module level attributes in _pyrepl.utils (python#139004)
  pythonGH-146527: Add more data to GC statistics and add it to PyDebugOffsets (python#146532)
  ...
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

interpreter-core (Objects, Python, Grammar, and Parser dirs)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.