Hello again, lets take as an example a so called ‘setup_gui’ function, which accepts as arguments the desired gui to be setup, if the new gui should replace a previous gui and a tuple of varied data(as some possible guis requires additional varied information specific to them).
That second argument above accepts an int or a string which is later passed to a function called inside ‘setup_gui’, named ‘clear_gui’. If it is an str the clear_gui will look for the gui into a current guis dictionary(all guis) before deleting, if it is an int, clear_gui will delete any gui at that index into a ‘current guis list’(just stacked guis) if it is present.
I used to make use of isinstance to check if the ‘setup_gui’ second argument is an int or a str; but should I instead sepate that second argument into two ‘index, name’? Because I heard how ‘unholy’ it was to use isinstance, which the function should act as if the supplied arg is right, but what if there are multiple right alternatives(of varied types) for an arg? What about that ‘varied data tuple argument’(the last one), is it right for the function to expect for a tuple containing varied data(depending of what info a specific gui requires)? Still about the last arg, I should mention it does not make use of isinstance or any conditional checking to be used, as it was supposed to be the exact data which the desired gui to be setup requires.
Thanks for any clarification.