GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — argparse in 3.14+ is importing `_colorize` earlier than necessary · Issue #148823 · python/cpython Closed Labels stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error DescriptionBug reportBug description:I say "earlier than necessary" because However this import is only actually deferred until an $ python -c "import sys; import argparse; print(sys.modules.get('_colorize')); argparse.ArgumentParser(); print(sys.modules.get('_colorize'))"None <module '_colorize' from '/usr/lib64/python3.14/_colorize.py'> This results in a noticeable %-wise increase in the effective import time when you actually use the module. Note that some of this time is also a lazy import of This gets a bit more noticeable in real terms on slower devices, so it would be nice to defer this until something actually needs colouring. Note that there are some plans to make CPython versions tested on:3.14, 3.15 Operating systems tested on:Linux Linked PRsActivity
MetadataMetadataAssigneesLabelsstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error Projects
MilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402520 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |