Is there swap function in Python?

Xin Liu lx1978 at 263.net
Sun Apr 6 16:16:07 EDT 2003


>
> What do you mean by the swap function? What should it do
> precisely?
>
> -- 
> René Pijlman
It is a function like swap(a, b) . Use to swap the value of a and b.
A example in C++ language maybe like:
template <class T> void swap(T & a, T & b)
{
    T * tmp;
    tmp = a;
    a = b;
    b = tmp;
    return
}






More information about the Python-list mailing list