Code: Select all
def getDirectionAxis(s=Gui.Selection.getSelectionEx()):
I needed to take it back to how it was . i.e.
Code: Select all
def getDirectionAxis(s=None):
s=Gui.Selection.getSelectionEx()
Code: Select all
def getDirectionAxis(s=Gui.Selection.getSelectionEx()):
Code: Select all
def getDirectionAxis(s=None):
s=Gui.Selection.getSelectionEx()
https://docs.python-guide.org/writing/gotchas/ wrote:Python's default arguments are evaluated once when the function is defined, not each time the function is called (like it is in say, Ruby).
Thank you very much Jonasb.jonasb wrote: ↑Sat Oct 23, 2021 8:37 pmhttps://docs.python-guide.org/writing/gotchas/ wrote:Python's default arguments are evaluated once when the function is defined, not each time the function is called (like it is in say, Ruby).
I would argue it's not a bug in python *if* it results in faster execution.mariwan wrote: ↑Sun Oct 24, 2021 9:56 amThank you very much Jonasb.jonasb wrote: ↑Sat Oct 23, 2021 8:37 pmhttps://docs.python-guide.org/writing/gotchas/ wrote:Python's default arguments are evaluated once when the function is defined, not each time the function is called (like it is in say, Ruby).
Correct, that must be the reason ... But it is not logical. I call that as a bug in python.
Anyway, I did what is required even if I didn't know that. I am new in python.
Thank you again.