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 christian.heimes, pitrou, vstinner
Date 2013-10-12.00:33:08
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1381537991.31.0.762180400628.issue19230@psf.upfronthosting.co.za>
In-reply-to
Content
To speedup Python startup, I propose to reimplement the keyword module in C. Attached patch implements it.

* Remove Lib/keyword.py
* Add Tools/scripts/keyword.py: script to build Modules/keyword.h
* The new module is Modules/keyword.c

I chose to change the keyword.kwlist type from list to tuple. The documentation only says they that kwlist is a "Sequence":
http://docs.python.org/dev/library/keyword.html#keyword.kwlist

The keyword is now used by the collections module in the implementation of namedtuple.

The keyword module is trivial: it only contains a sequence of strings and a method checking if a string is part of this sequence. It would be simpler to add this to an existing module. I suppose that a new module was added for technical reasons.
History
Date User Action Args
2013-10-12 00:33:11vstinnersetrecipients: + vstinner, pitrou, christian.heimes
2013-10-12 00:33:11vstinnersetmessageid: <1381537991.31.0.762180400628.issue19230@psf.upfronthosting.co.za>
2013-10-12 00:33:11vstinnerlinkissue19230 messages
2013-10-12 00:33:10vstinnercreate