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
May be you are looking for weakref module:
http://www.python.org/doc/current/lib/module-weakref.html
--
Baiju M
--
http://mail.python.org/mailman/listinfo/python-list
ripley wrote:
> 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
>
>
> Bu
>
> Thanks for your so detailed explain, I think I know you, But my Engish
> is not enough
> to explain.
>
> I create same object in Tree, I want to update Tree, when I need to
> delete subtree.
> If where no references, I can't do that. some thing like blow:
> for i in list:
>del i
This ma
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
[EMAIL PROTECTED] i'rta:
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?
>
>
You must undestand that 'a' and 'b' are names. Y
[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
--
http://mail.python.org/mailman/listinfo/python-list