This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: move opcode-related logic from modulefinder to dis
Type: enhancement Stage: resolved
Components: Library (Lib) Versions: Python 3.11
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: BTaskaya, gvanrossum, iritkatriel, serhiy.storchaka
Priority: normal Keywords: patch

Created on 2021-08-26 15:25 by iritkatriel, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 28246 merged iritkatriel, 2021-09-08 22:19
Messages (6)
msg400355 - (view) Author: Irit Katriel (iritkatriel) * (Python committer) Date: 2021-08-26 15:25
The modulefinder library module has logic that understands particular opcodes (such as the scan_opcodes method). This should be encapsulated in the dis module, and modulefinder should not process opcodes directly.
msg401445 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2021-09-09 08:39
What is wrong with this? Is such logic used in the dis module or any other module outside modulefinder?
msg401446 - (view) Author: Irit Katriel (iritkatriel) * (Python committer) Date: 2021-09-09 08:55
The modulefinder module shouldn’t know what sequence of opcodes the compiler emits for import. 

For example, if the compiler changes you get a fairly high level test failure that you need to debug. After this refactor the test failure is more obviously pointing to what changed.
msg401460 - (view) Author: Batuhan Taskaya (BTaskaya) * (Python committer) Date: 2021-09-09 10:30
Does find_imports/find_store_names have to be public? I think the relocation is fine, but making them public without any use case from outside can be avoided at least for now.
msg401463 - (view) Author: Irit Katriel (iritkatriel) * (Python committer) Date: 2021-09-09 11:03
I agree, I’ll make them private.
msg401469 - (view) Author: Irit Katriel (iritkatriel) * (Python committer) Date: 2021-09-09 13:04
New changeset 04676b69466d2e6d2903f1c6879d2cb292721455 by Irit Katriel in branch 'main':
bpo-45017: move opcode-related logic from modulefinder to dis (GH-28246)
https://github.com/python/cpython/commit/04676b69466d2e6d2903f1c6879d2cb292721455
History
Date User Action Args
2022-04-11 14:59:49adminsetgithub: 89180
2021-09-09 13:05:31iritkatrielsetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2021-09-09 13:04:20iritkatrielsetmessages: + msg401469
2021-09-09 11:03:32iritkatrielsetmessages: + msg401463
2021-09-09 10:30:50BTaskayasetnosy: + BTaskaya
messages: + msg401460
2021-09-09 08:55:06iritkatrielsetmessages: + msg401446
2021-09-09 08:39:49serhiy.storchakasetnosy: + serhiy.storchaka
messages: + msg401445
2021-09-08 22:19:48iritkatrielsetkeywords: + patch
stage: patch review
pull_requests: + pull_request26666
2021-08-26 15:28:19gvanrossumsetnosy: + gvanrossum
2021-08-26 15:25:23iritkatrielcreate