Thanks all, you all are nice man.
Dennis Lee Bieber 写道:
> while len(lst): #list is a built-in function, don't use as a name
> del lst[0] #delete the first item IN the lst
>
I found Dennis 's code is usefull that is a way to solve my problem.
--
http://mail.python.org
Laszlo Nagy wrote:
> You must undestand that 'a' and 'b' are names. You can only delete
> names, not objects. Objects are freed by the garbage collector,
> automatically. Probably you used to write programs in C or Pascal or
> other languages with pointers. In Python, there are no pointers, just
>
Boris Borcic wrote:
> [EMAIL PROTECTED] wrote:
> class A:
> > ... pass
> > ...
> a = A()
> b = a
> del b
> a
> > <__main__.A instance at 0x00B91BC0>
> > I want to delete 'a' through 'b', why It does't?
> > How can I do that?
>
> del a,b
But 'b' is also deleted, i want u