4. Given a geometric sequence $\left\{a_{n}\right\}$ with common ratio $q$, the sum of the first $n$ terms $S_{n}>0(n=1,2, \cdots)$. Then the range of values for $q$ is $\qquad$ .
4. $(-1,0) \cup(0,+\infty)$.

Since $S_{n}>0(n=1,2, \cdots)$, we have $a_{1}>0$. When $q=1$, $S_{n}=n a_{1}>0$.
When $q \neq 1$,
$$
S_{n}=\frac{a_{1}\left(1-q^{n}\right)}{1-q}>0(n=1,2, \cdots) \text {. }
$$

Therefore, $q \in(-1,0) \cup(0,1) \cup(1,+\infty)$.
In summary, $q \in(-1,0) \cup(0,+\infty)$.