del() function - cannot find documentation

Lawrence D'Oliveiro ldo at geek-central.gen.new_zealand
Mon Oct 11 13:01:48 CEST 2010

In message <vedta6d9i8no1h6cmkb5nl7np5lfov1her at>, Tim Roberts wrote:

> This kind of confusion is, in my opinion, the primary reason why
> parentheses should never be used with "del" and "return", as we so
> commonly see.

It’s the kind of “confusion” that could be cleared up with 30 seconds’ 
access to a Python interpreter:

    ldo at theon:~> python3.1
    Python 3.1.2 (release31-maint, Sep 26 2010, 16:45:30) 
    [GCC 4.4.5] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>> print
    <built-in function print>
    >>> del
      File "<stdin>", line 1
    SyntaxError: invalid syntax
    >>> return
      File "<stdin>", line 1
    SyntaxError: 'return' outside function

If that doesn’t hint to you that “del” and “return” are not functions, I 
don’t know what does...

More information about the Python-list mailing list