What's is the Buddhist view on persistence or grit? We are always taught to have grit, show resilience and never to give up in difficult situations. In the lights of my knowledge in Buddhism, I think of these as a manifestation of strong attachment to objects and emotions. Am I right? Should these qualities be valued? What is the Buddhist viewpoint? Thanks!
It's one of the 4 Iddhipadas, namely the second one.:

Four Bases of Power or Success (Iddhipada)

Desire (chanda)
Persistence/Energy/Effort (viriya)
Intention, Mind, Thoughtfulness (citta)
Investigation/Discrimination (vimamsa or panna)


They are all needed in order to progress on the Path. Without them (especially the second one) the mind will not be fit for meditation practice.
One needs energy to apply the mind to the arising and ceasing of phenomena. Constant application of mind leads to concentration and mindfulness which leads to clarity of mind. Seeing clearly leads to freedom from suffering which eventually leads to Nibbana.
So yeah, these qualities should be valued and cultivated.