[Python-Dev] Re: Rationale behind removing kwdict from keyword.py? (original) (raw)
Bob Ippolito bob at redivi.com
Wed Jul 28 06:20:42 CEST 2004
- Previous message: [Python-Dev] Re: Rationale behind removing kwdict from keyword.py?
- Next message: [Python-Dev] Re: Rationale behind removing kwdict from keyword.py?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Jul 28, 2004, at 12:09 AM, Fernando Perez wrote:
Jeff Epler wrote:
In 2.3, all = ["iskeyword", "kwlist"]
In the absence of separate documentation, I think all may be the best hint you have about what the "external API" of a module is. Indeed, lesson learned. In my slim defense, seeing in help(keyword): DATA all = ['iskeyword', 'kwlist'] keyword = 'yield' kwdict = {'and': 1, 'assert': 1, 'break': 1, 'class': 1, 'continue': 1... kwlist = ['and', 'assert', 'break', 'class', 'continue', 'def', 'del',... I (mistakenly) assumed kwdict was safe for usage. Relying on help(), while I acknowledge may have been mistaken, is not IMHO a completely farfetched error. Oh well, live and learn :) Thanks to all for the clarifications. I'll be far more careful in the future with my usage of stuff from the stdlib.
FWIW, I think I've made the same mistake before for the same reasons.
This sounds like a bug in pydoc. If all is defined, help should
probably only be given for items in it (public API).
-bob -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 3589 bytes Desc: not available Url : http://mail.python.org/pipermail/python-dev/attachments/20040728/53ebb933/smime.bin
- Previous message: [Python-Dev] Re: Rationale behind removing kwdict from keyword.py?
- Next message: [Python-Dev] Re: Rationale behind removing kwdict from keyword.py?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]