Weld overlapping Vertices


How can I weld all the vertices in an editable poly object by a threshold of 0.001 using script?

I want to use this as a shortcut for welding overlapping vetices. Because, I do it a lot and it takes 2 or 3 steps to achieve it. So, I thought assigning a shortcut key for welding overlapping vertices might save a lot of time for me.

I'd greatly appreciate anyone's help.

Thank You