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: inspect.getmembers iterator version
Type: enhancement Stage: resolved
Components: Library (Lib) Versions: Python 3.10
process
Status: closed Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: ronaldoussoren, signing_agreement
Priority: normal Keywords:

Created on 2020-11-03 17:49 by signing_agreement, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (5)
msg380287 - (view) Author: (signing_agreement) * Date: 2020-11-03 17:49
inspect.getmembers should have a generator version.
msg380289 - (view) Author: Ronald Oussoren (ronaldoussoren) * (Python committer) Date: 2020-11-03 18:18
why?
msg380295 - (view) Author: (signing_agreement) * Date: 2020-11-03 19:23
The object it deals with is already loaded, but in cases I see online, users tend to examine one member at a time.
msg380298 - (view) Author: Ronald Oussoren (ronaldoussoren) * (Python committer) Date: 2020-11-03 20:09
I personally don't think it is worthwhile to add another API for this without a good use case.  The memory overhead of eagerly creating a list should be fairly small.
msg380300 - (view) Author: (signing_agreement) * Date: 2020-11-03 20:20
That is a fair point. I selected a few popular python libraries to test, and they all return a small list.
History
Date User Action Args
2022-04-11 14:59:37adminsetgithub: 86420
2020-11-03 20:20:54signing_agreementsetstatus: open -> closed

messages: + msg380300
stage: resolved
2020-11-03 20:09:09ronaldoussorensetmessages: + msg380298
2020-11-03 19:23:38signing_agreementsetmessages: + msg380295
2020-11-03 18:18:33ronaldoussorensetnosy: + ronaldoussoren
messages: + msg380289
2020-11-03 17:49:42signing_agreementcreate