Why are you asking us whether it's valid? You should
know before you post, since this is a testable item, and therefore out of scope for Stack Overflow. "Pythonic" is opinionated, and also off-topic, unless you can point out a
specific technique and explain your worries about that point. Otherwise, you're asking for a code review -- on the wrong site. —
Prune 9 secs ago