Shiny for Python has you pass in functions to App() rather than grouping them into a class or using decorators. It seems a bit unpythonic to me. You even nest function definitions for some reason?
@meejah It just seems like they copy-pasted the R API into Python. It works in R because it's a very functional language, but idiomatic/user-friendly Python uses classes in my opinion. Especially because a Shiny app is so cleanly modelled as a class that implements an interface.
@meejah Touche, I think that's an accurate observation. But really it's not that I prefer inheritance, I just think that Python has better tools to create rich APIs using it, via metaclasses and class hooks.
@multimeric That's fine, we're allowed to prefer our own style -- but I don't think there's anything intrinsically "Pythonic" about that approach (and there's plenty of Python that specifically doesn't take such an approach, preferring composition).
Add comment