D H a écrit : > Fredrik Lundh wrote: > >> vbgunz wrote: >> >>>> I have new a list , when it hava large number of values, I wonna to >>>> delete all the values in it,how to do? >>> >>> >>> something like this will probably help. >>> >>> x = [1,2,3,4,5,6,7,8,9] >>> y = x >>> >>> list([x.pop() for z in xrange(len(x))]) >>> >>> print x, y # [] [] >> >> >> if you don't know how to do things, you don't need to post. >> >> if you know why this is about the dumbest way to do what you're doing, >> and you're posted this on purpose, you really need to grow up. >> >> </F> > > > He already posted before your post that he made a mistake.
Not the same one. Or there are missing posts on my provider's usenet service. > You obviously ignored that and invented some argument that he > posted with malicious intentions. Fredrik may have been a bit harsh, but the fact is that vbgunz's solution for clearing a list *is* the dumbest possible - and it should be obvious for anyone past CS101. Now since a lot of Python newbies read this newsgroup, uncorrected bad answers are far worse than no answer at all. > That better describes most of > your thousands of annoying posts. Fredrik - aka the effbot - is a Python expert, and a major contributor here. He's known to be usually very helpful, even for questions that are in the Fine Manual or in the FAQs. I'm afraid you can say so. You may not like the way he corrected vbgunz - and I'll wholefully agree on this - but this last sentence is total bullshit. -- http://mail.python.org/mailman/listinfo/python-list