I like to listen to a piece to get the general idea of it, but I don't always.
To learn a piece without hearing how rhythm goes, it strengthens my sightreading, if I have heard the piece before, I can focus more on the notes than on the rhythm.
I generally find something easier to learn if I have heard a recording, but also a piece has to be played from ones own interpretation. If you listen to the one recording of a piece over and over, or even a few recording of a piece over and over, you might adopt the interpretation of the pianist(s) playing the recordings.
When I am half-way through a piece is generally when I start listening to recordings of it. I can see what bits I have got drastically wrong, but by then I would have developed how I believe the finer points should sound.