[Python-Dev] Reorganizing re and curses related code (original) (raw)

Antoine Pitrou solipsis at pitrou.net
Fri Nov 3 06:12:56 EDT 2017


Sounds good to me :-)

Regards

Antoine.

On Fri, 3 Nov 2017 12:01:28 +0200 Serhiy Storchaka <storchaka at gmail.com> wrote:

Currently the implementation of re and curses related modules is sparsed over several files:

re: Lib/re.py Lib/srecompile.py Lib/sreconstants.py Lib/sreparse.py sre: Modules/sre.c Modules/sreconstants.h Modules/sre.h Modules/srelib.h curses: Include/pycurses.h Modules/cursesmodule.c Modules/cursespanel.c I want to make the re module a package, and move sre*.py files into it. Maybe later I'll add the sreoptimize.py file for separating optimization from parsing and compiling to an internal code. The original sre*.py files will be left for compatibility for long time, but they will just import their content from the re package. sre implementation will be moved into the Modules/sre/ directory. This will just make them to be in one place and will decrease the number of files in the Modules/ directory. The implementations of the curses and cursespanel modules together with the common header file will be moved into the Modules/curses/ directory. Excluding pycurses.h from the set of global headers will increase the speed of rebuilding when modify just the curses implementation (I did this too much recent times). In future the implementation of menu and forms extensions will be added (the patch for menu has beed provided years ago). Since cursesmodule.c is one of the largest file (it defines hundreds of functions), it may be worth to extract the implementation of the curses.window class into a separate file. And I want to implement the support of "soft function-key labels". All this will increase the number of curses related files to 7. curses already is a package. Since virtually all changes in these files at recent years have been made by me, I don't think this will harm other core developers. Are there any objections?



More information about the Python-Dev mailing list