
On Sun, Apr 19, 2020 at 3:48 PM Stephen J. Turnbull <turnbull.stephen.fw@u.tsukuba.ac.jp> wrote:
I'm arguing that multiple changes in Python, and additional experience for me, mean that I run into same name arguments much less frequently nowadays than I once did, frameworks like Flask notwithstanding. There are several reasons for that, including:
1. Variable naming that refers to the role in the application, rather than the role in the function called. 2. Constructs like comprehensions and zip() that make writing helper functions that call for same name arguments less attractive. 3. Using local rather than global functions in helper roles, eliminating same name arguments in favor of nonlocal access.
None of those is a panacea; 2 & 3 are completely inapplicable to the render_template example, and 1 is a matter of style that I think is becoming widespread in the Python community (at least in the code I have to read frequently :-) but is certainly your choice, and any programmer's choice, not mine.
In the case of render_template, I effectively define both ends of it, since the template is under my control. So the variable names refer to both the role in the calling function AND the role in the template, and will very frequently correspond. So all three of these concerns are inapplicable here. ChrisA