We show that the assumption of quasiperiodic boundary conditions (thos
e that interpolate continuously periodic and antiperiodic conditions)
in order to compute partition functions of relativistic particles in 2
+ 1 space-time can be related with anyonic physics. In particular, in
the low temperature limit, our result leads to the well-known second
virial coefficient for anyons. Besides, we also obtain the high temper
ature limit as well as the full temperature dependence of this coeffic
ient.