Grief and Acceptance

I like what one YT Python lecturer says about "Knowing it All". You need to accept that you will NEVER know it all.

You need to trust that the research tools you have used thus far to tackle problems will be there for you in the future to help you get through those unknown future obstacles.

There are moments of grief when I think about my comparatively slow rate of progress (as an Old Man Learning to Code) and the fact that, indeed, I will never reach the mountain top. I will never know it all (that is, err, not only about Python, HTML, CSS, Javascript, VBA, AHK, Bash, GitHub, etc, but also about an infinite number of other things to be grasped in a lifetime). But there is no choice but to accept. I am finite. My brain is finite and small. I just need to humble myself and accept.

So getting back to the goal of this blog: Keeping a log of my progress and set backs in learning to code. Today's problem is nested functions; that is, function calls inside of other function calls. More specifically, how can I pass needed parameters from the outer code, through the outermost function and into the inner functions in some sort of orderly manner?

TO BE CONTINUED:  Google search results: "Python pass arguments to inner function"

The plan for the moment is to rely on a list of plural dictionaries, each one starting with a unique key named 'fN_name_as_called' where N is an integer starting at zero and indicating how deep in sublevels it is called upon, for example:

def top_level_func(list_of_passed_dicts = [dict0, dict1a, dict1b, dict2aa]
    where dict0 = {'f0_as_called': 'fn,top_level_func', "f0_param_1": "stringMethodName", "f0_param_2": "Discussion_number", "f0_param_3": "blah blah" ...}
    where dict1a = {'f1a_as_called': 'f2,first_sub-level_func', "f1a_param_1": ...
in which fn and f2 are module names identifying where the respective function resided

TO BE CONTINUED

I'm not the first to encounter the too-many-arguments problem
Above is Arjan's solution --^^^---
and here is Arjan's Git Repo for the "context" passing problem: ArjanCodes (all examples) (context here)




Comments

Popular posts from this blog

Links for Python Noobs

The Learn HOW to Learn Page

Welcome to Circular Import Hell