My apologies. I must be dense. Why do you want to do this from Python? Can't you accomplish the same thing more easily with a Gmail filter which deletes all messages sent to python-list@python.org? Also, I assume that if you use "x...@gmail.com" only so you can send mail to the list, why not just disable message delivery altogether through the Mailman interface. That would avoid the necessity of deleting the mail at all.
> When i open my gmail with thunderbird ,the emails which are sent to > python-list@python.org are still in my gmail... Do you perhaps need to force Thunderbird to refresh its view of your mailbox? Skip -- https://mail.python.org/mailman/listinfo/python-list