This paper deals mainly with the idempotency of an operator or a matrix T given by \(T=c_1 \Pi _1 +c_2 \Pi _2+\cdots +c_n\Pi _n,\) where n is an arbitrary positive integer, \(\{\Pi _{1},\Pi _{2},\ldots ,\Pi _{n}\}\) is a collection of mutually commutative idempotents, and \(c_1,c_2,\ldots ,c_n\) are complex numbers. Some previous results in the cases of \(n=2\) and \(n=3\) are generalized, and meanwhile some new characterizations of the idempotency of T are obtained.