Hi, I recently noticed that the "help" function behaves rather unhelpfully when one tries it on builtin keywords, as opposed to functions.
For example, taking the much abused "lambda", a newbie might try to do the following to get more enlightened about lambda. >>> help(lambda) File "<stdin>", line 1 help(lambda) ^ SyntaxError: invalid syntax What he gets is a very unhelpful syntax error! Similarly for any keyword. For example, for all Python versions before 3.0... >>> help(exec) File "<stdin>", line 1 help(exec) ^ SyntaxError: invalid syntax I don't have a problem with "help" not helping out with keywords. The problem is that it advertises itself so... $ python3 >>> help(help) Help on _Helper in module site: Type help() for interactive help, or help(object) for help about object. So, the advertisement it gives is that it can help on any object, and newbies to Python might interpret this as help on anything, including keywords. I did not check if there is a bug on this, but if the situation can be fixed in Py3k, it would be great. I suggest that "help()" either gives a single-line help for keywords also, or gracefully die down with a proper error string, telling "<keyword> is a Python keyword" instead of the ugly SyntaxError. Thanks -- -Anand _______________________________________________ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com