[Python-Dev] Pre-PEP Idea

Paul Prescod paul@prescod.net
Sat, 15 Jul 2000 14:13:55 -0500


Moshe Zadka wrote:
> 
> ...
>
> -- have all that wonderful stuff in help.py
> -- have the startup code of the *interactive interpreter only* do
> "from help import help" at the beginning.

Sorry, that's a part I should have explanied more. 

help is not a magical function/statement but an instance with a repr
that does the right thing. And yes, it will probably only be loaded at
the repl. Or it could be a 10-line instance that loads its content when
it is actually used. That might allow

python -c "import help"

Here's a sample definition.

class helploader:
	def __repr__( self ):
		global help
		from helptext import help
		return repr( help )
	def __call__( self ):
		global help
		from helptext import help
		return repr( help )
help=helploader()

-- 
 Paul Prescod - Not encumbered by corporate consensus
It's difficult to extract sense from strings, but they're the only
communication coin we can count on. 
	- http://www.cs.yale.edu/~perlis-alan/quotes.html