In code, list.clear is just ignored.
At the terminal, list.clear shows
<built-in method clear of list object at 0x000001C9CFEC4240>


in code:
x = [1,2,3]
x.clear
print(len(x))
3

at terminal:
x = [1,2,3]
x.clear
<built-in method clear of list object at 0x000001C9CFEC4240>
print(len(x))
3


Caused me an hour of frustration before I noticed list.clear() was what I needed.

x = [1,2,3]
x.clear()
print(len(x))
0

--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to