It depends on the city, there are cities that have a stronger biking tradition then others. In the bigger cities such as Lisbon and Porto they don't have a very strong biking tradition, but Aveiro does. They used to have bikes available to anyone that could put a coin into a slot to release a chain. When they finished using the bike all you had to do was tie it up at another station and retrieve a coin to same value that you had placed in the first place.
Unfortunately, it couldn't last long before they started disappearing, they even found some bikes in Spain and as far off as France.
That seems to be a great solution, I mean, picking up a bike when we need it and parking it at our location seems ideal, but hard to accomplish at the same time.