del() function - cannot find documentation

Tim Roberts timr at probo.com
Fri Oct 8 02:11:41 EDT 2010


Chris Rebert <clp2 at rebertia.com> wrote:
>On Thu, Oct 7, 2010 at 1:12 PM,  <mafeusek at gmail.com> wrote:
>>
>> there is following python script:
>>
>> mine = { 1: "sd", 2: "mk" }
>> del(mine[1])
>> print mine
>>
>> the problem is I cannot find any information about del() function in
>> python 2.7 documentation.
>> is it a documentation bug or I misunderstand something about del()?
>
>del is a *statement*, *not* a function:
>http://docs.python.org/reference/simple_stmts.html#the-del-statement

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.
-- 
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.



More information about the Python-list mailing list