where does 'del' come from?

Zigron zigron at jps.net
Tue Jun 8 00:19:21 EDT 1999


    I *believe* that 'del' is a keyword, thus, isn't exactly /defined/
anywhere
like functions and the likes are. Its like 'if', and 'while', and 'print'..

--Stephen

<sragsdale at my-deja.com> wrote in message news:7jhuu5$8d4$1 at nnrp1.deja.com...
> A fairly academic question, but I'm curious nonetheless.  Where is 'del'
> defined?  Functions like 'join' are obviously in the string package,
> 'range' is a builtin, but I can't seem to find 'del' anywhere.
>
> Python 1.5.2 (#12, Jun  2 1999, 19:23:30) [C] on irix646
> Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
> >>> dir(__builtins__)
> ['ArithmeticError', 'AssertionError', 'AttributeError', 'EOFError',
> 'Ellipsis', 'EnvironmentError', 'Exception', 'FloatingPointError',
> 'IOError', 'ImportError', 'IndexError', 'KeyError', 'KeyboardInterrupt',
> 'LookupError', 'MemoryError', 'NameError', 'None',
> 'NotImplementedError', 'OSError', 'OverflowError', 'RuntimeError',
> 'StandardError', 'SyntaxError', 'SystemError', 'SystemExit',
> 'TypeError', 'ValueError', 'ZeroDivisionError', '__debug__', '__doc__',
> '__import__', '__name__', 'abs', 'apply', 'buffer', 'callable', 'chr',
> 'cmp', 'coerce', 'compile', 'complex', 'delattr', 'dir', 'divmod',
> 'eval', 'execfile', 'exit', 'filter', 'float', 'getattr', 'globals',
> 'hasattr', 'hash', 'hex', 'id', 'input', 'int', 'intern', 'isinstance',
> 'issubclass', 'len', 'list', 'locals', 'long', 'map', 'max', 'min',
> 'oct', 'open', 'ord', 'pow', 'quit', 'range', 'raw_input', 'reduce',
> 'reload', 'repr', 'round', 'setattr', 'slice', 'str', 'tuple', 'type',
> 'vars', 'xrange']
> >>> range
> <built-in function range>
> >>> del
>   File "<stdin>", line 1
>     del
>        ^
> SyntaxError: invalid syntax
>
>
> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.






More information about the Python-list mailing list