Yong Cui
1 min readAug 6, 2020

--

Your example doesn’t look like nested functions.

It’s OK to have nested functions, and I use them sometimes. It should be noted that if the nested functions are too big (say 10 lines of code), you may want to move them out, because as you’re aware, nested functions can create some distraction that affects readability.

--

--

Yong Cui
Yong Cui

Written by Yong Cui

Work at the nexus of biomedicine, data science & mobile dev. Author of Python How-to by Manning (https://www.manning.com/books/python-how-to).

Responses (1)