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.

Author vstinner
Recipients Greg Price, benjamin.peterson, ezio.melotti, mcepl, serhiy.storchaka, vstinner
Date 2019-08-13.12:23:29
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1565699009.76.0.879436140962.issue32771@roundup.psfhosted.org>
In-reply-to
Content
> This will remove awkward maneuvers like ast.c importing unicodedata in order to perform normalization.

unicodedata is not needed by default. ast.c only imports unicodedata at the first non-ASCII identifier. If you application (and all dependencies) only use ASCII identifiers, unicodedata is never loaded. Loading it dynamically reduces the memory footprint. 

Raw measure on my Fedora 30 laptop:

$ python3
Python 3.7.4 (default, Jul  9 2019, 16:32:37) 
[GCC 9.1.1 20190503 (Red Hat 9.1.1-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.system(f"grep ^VmRSS /proc/{os.getpid()}/status")
VmRSS:	   10236 kB

>>> import unicodedata
>>> os.system(f"grep ^VmRSS /proc/{os.getpid()}/status")
VmRSS:	   10396 kB

It uses 160 KiB of memory.
History
Date User Action Args
2019-08-13 12:23:29vstinnersetrecipients: + vstinner, benjamin.peterson, mcepl, ezio.melotti, serhiy.storchaka, Greg Price
2019-08-13 12:23:29vstinnersetmessageid: <1565699009.76.0.879436140962.issue32771@roundup.psfhosted.org>
2019-08-13 12:23:29vstinnerlinkissue32771 messages
2019-08-13 12:23:29vstinnercreate