Deuteronomy 34

Deuteronomy 34:9

"And Joshua the son of Naue was filled with the spirit of knowledge, for Moses had laid his hands upon him; and the children of Israel listened to him; and they did as the Lord commanded Moses."
Did Joshua write his own epitaph in Deuteronomy 34:9?

Against the idea that Joshua wrote Moses' epitaph, this verse is quoted and claimed that Joshua would not have written such a thing. In the Ancient Near East, leaders were always considered to be the repository of Wisdom, so that there is no reason at all that Joshua, the leader of the people, could not have said this about himself - no less than Pharaohs could have said similar things about themselves.