I think that this goes without saying that of course you can learn about different things in life through a long-term friendship, but sometimes it helps to acknowledge not only when a friendship is temporary, but also what it can help you understand or progress you general understanding of things.
[Edit 1: This post is not to say that you should get into a short-term friendship with someone for the sole idea that you would only learn a lesson of some sorts. It's something that can happen with general friendships as well, because sometimes, people just grow apart]