[issue42243] Don't access the module dictionary directly

2020-12-28 Thread Erlend Egeberg Aasland
Change by Erlend Egeberg Aasland : -- stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___

[issue42243] Don't access the module dictionary directly

2020-12-28 Thread Erlend Egeberg Aasland
Change by Erlend Egeberg Aasland : -- resolution: -> wont fix ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue42243] Don't access the module dictionary directly

2020-11-02 Thread Raymond Hettinger
Raymond Hettinger added the comment: I would leave it as-is. -- nosy: +rhettinger ___ Python tracker ___ ___ Python-bugs-list

[issue42243] Don't access the module dictionary directly

2020-11-02 Thread Erlend Egeberg Aasland
Erlend Egeberg Aasland added the comment: > Are all these occurrences in the module initialization code? Most of them, but not all. > but rewriting can introduce new bugs. Of course. > You can do this, but it will be treated as pure cosmetic change. It can be > accepted if the new code

[issue42243] Don't access the module dictionary directly

2020-11-02 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Are all these occurrences in the module initialization code? I think there is nothing wrong with this. Yes, the code can be a little clearer if use PyObject_GetArrt or PyModule_Add*, but rewriting can introduce new bugs. The remark in the documentation is

[issue42243] Don't access the module dictionary directly

2020-11-02 Thread Erlend Egeberg Aasland
Change by Erlend Egeberg Aasland : -- keywords: +patch pull_requests: +22018 stage: -> patch review pull_request: https://github.com/python/cpython/pull/23101 ___ Python tracker

[issue42243] Don't access the module dictionary directly

2020-11-02 Thread Erlend Egeberg Aasland
New submission from Erlend Egeberg Aasland : Quoting from https://docs.python.org/3.10/c-api/module.html: "It is recommended extensions use other PyModule_* and PyObject_* functions rather than directly manipulate a module’s __dict__." A number of modules still access the module dictionary