[Python-ideas] Removing the del statement

George Sakkis gsakkis at rutgers.edu
Fri Sep 28 04:13:11 CEST 2007


On 9/27/07, Adam Atlas <adam at atlas.st> wrote:
>
>
> On 27 Sep 2007, at 21:47, George Sakkis wrote:
>
> > I guess this has very few to zero chances of being considered, even
> > for Python 3, but this being python-ideas I guess it's ok to bring
> > it up. IMO the del statement is one of the relatively few
> > constructs that stick out like a sore thumb. For one thing, it is
> > overloaded to mean three different things:
> > 1) del x: Remove x from the current namespace
> > 2) del x[i]: Equivalent to x.__delitem__(i)
> > 3) del x.a: Equivalent to x.__delattr__('a') and delattr(x,'a')
>
>
> I guess this has very few to zero chances of being considered, even
> for Python 3, but this being python-ideas I guess it's ok to bring it
> up. IMO the = statement is one of the relatively few constructs that
> stick out like a sore thumb. For one thing, it is overloaded to mean
> three different things:
> 1) x = : Assign x in the current namespace
> 2) x[i] = : Equivalent to x.__setitem__(i)
> 3) x.a = : Equivalent to x.__setattr__('a') and setattr(x,'a')
>
>
> (Sorry for the slight sarcasm, but I hope you see my point. I don't
> see why the deletion statement should go while the perfectly
> complementary and nearly-identically-"overloaded" assignment
> statement should stay.)


Apples to oranges. I thought It would be obvious and that's why I didn't
mention it, but getitem/setitem and friends use almost universally known
punctuation; OTOH only Python AFAIK uses a keyword for a relatively
infrequent operation.

George
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20070927/c0d12093/attachment.html>


More information about the Python-ideas mailing list