What is not objects in Python?
Marc 'BlackJack' Rintsch
bj_666 at gmx.net
Mon Sep 29 11:29:11 EDT 2008
On Mon, 29 Sep 2008 11:14:36 -0400, Mel wrote:
> George Sakkis wrote:
>> As Terry Reedy wrote, partly history and partly practicality. There's
>> no philosophical reason why we write "len(x)" (generic builtin),
>> "x.append(1)" (method) or "del x[i]" (statement). The latter in
>> particular is IMHO a design wart; there's no reason for not writing it
>> as "x.delete(i)".
>
> `del x` has almost nothing to do with `x`, and almost everything to do
> with a namespace containing `x`. The object doesn't know what namespace
> it's in.
But George's example was ``del x[i]`` which *has* something to do with
`x` as it mutates the object (or at least calls `x.__delitem__()`).
Ciao,
Marc 'BlackJack' Rintsch
More information about the Python-list
mailing list