[issue43093] Make modules picklable

2021-02-01 Thread Arusekk
Arusekk added the comment: Sorry, I forgot to state what is my actual goal: for the module objects to be pickleable in native CPython (possibly from C layer) without the need to add this to every code that wants to pickle module objects. The point is that they can already be unpickled from

[issue43093] Make modules picklable

2021-02-01 Thread Arusekk
New submission from Arusekk : Currently pickling functions and types stores modules by their name. So I believe it is possible to support pickling module objects with the following code (based on the logic in PyPy, which supports pickling modules): import copyreg import types import pickle

[issue40519] Preserve AttributeError exception context in __getattr__

2020-05-05 Thread Arusekk
Arusekk added the comment: Feel free to reuse the patches if you have better ideas -- Added file: https://bugs.python.org/file49123/robust.patch ___ Python tracker <https://bugs.python.org/issue40

[issue40519] Preserve AttributeError exception context in __getattr__

2020-05-05 Thread Arusekk
New submission from Arusekk : This is another attempt at issue 39865, but with a different attitude. Please see that issue for some extra motivation for this change. My suggestion is to change getattr logic, which now is (in this case): def getattr(obj, attr): try: return

[issue34372] Compiler could output more accurate line numbers

2018-08-10 Thread Arusekk
New submission from Arusekk : If this is a duplicate, please excuse me. In particular, the most noticeable inaccuracy happens when the postfix if-else expression is involved. Maybe there are more of them. The problem is quite self-explaining. The module named 'dis' will be helpful

[issue17852] Built-in module _io can lose data from buffered files at exit

2018-01-24 Thread Arusekk
Arusekk <arek_...@o2.pl> added the comment: Since the issue seems to have been active lately, may I suggest my view on solving it. One solution that comes to my mind is to keep a weak reference to the file, and to register an atexit function per file (and to unregister it when th