You are correct that the first matching scope is the one that is applied. But that doesn't mean nesting doesn't work.
Suppose we have the following text:
With this syntax definition:
Q: What is the scope of my_function?
A: entity.name.function.python and my-function.python, with the styling (color scheme/.tmTheme) going from most specific to least specific.
Q: What is the scope of my_other_function?
A: Just entity.name.function.python