  Let $X$ be a nilpotent space such that there exists $p\geq 1$ with
$H^p(X,\mathbb Q) \ne 0$ and $H^n(X,\mathbb Q)=0$ if $n>p$. Let $Y$ be a
m-connected space with $m\geq p+1$ and $H^*(Y,\mathbb Q)$ is finitely generated
as algebra. We assume that $X$ is formal and there exists $p$ odd such that
$H^p(X,\mathbb Q) \ne 0$. We prove that if the space $\mathcal F(X,Y)$ of
continuous maps from $X$ to $Y$ is formal, then $Y$ has the rational homotopy
type of a product of Eilenberg Mac Lane spaces. At the opposite, we exhibit an
example of a formal space $\mathcal F(S^2,Y)$ where $Y$ is not rationally
equivalent to a product of Eilenberg Mac Lane spaces.
