[Tutor] Functional Programming in Python
WolfRage
wolfrage8765 at gmail.com
Thu Apr 2 18:18:28 CEST 2015
These are just some questions that I have regarding the topic of
Functional Programming. I am working towards a more functional approach
to programming but acknowledge that it is far from Functional,
especially since this is mostly impossible in Python.
Questions:
What are the best practices to create more Functional Python?
What are your thoughts on Functional in Python?
Currently I am re-writing functions to reduce their side effects.
I am also removing the state from objects and putting it into a closure
type function.
However with callback based systems (GUI) this seemed impossible, so
instead I am abusing a coroutine to maintain the state of the application.
But is it abuse or does it seem like a good way to handle the callback
system? The benefit to me at this time is limited, but any errors in
state are confined to a single location, which is nice.
What do you think about using a coroutine to handle state, how would you
do it better in a callback based system.
Thank you for your insights.
More information about the Tutor
mailing list