Closed dekrypted closed 9 months ago
dawg this is why i fucking hate python what the fuck is "nonlocal" even supposed to mean????
for some reason when wrapping functions within functions, you have to nonlocal a variable from the parent function to access it in the child function, like global, its python what do u expect
After 600,000 lines of Python AI code have I ever used a function within a function. Never seen 3rd party modules do it either. By the time you get to that point you would create a class. So, I ask... Why?
After 600,000 lines of Python AI code have I ever used a function within a function. Never seen 3rd party modules do it either. By the time you get to that point you would create a class. So, I ask... Why?
for a VERY specific case using WinAPI in where there is pretty much no other way to go about it... using c functions in python especially winapi with all the types is kind of a pain in the ass... and the hardcoded nature of it makes it pretty much unavoidable
there's gotta be a different way you can do what you want to do. i have never even fucking heard of a "nonlocal" keyword being used anywhere for any reason. i'm probably not going to "fix" this since the project is more or less abandoned now, i have better things to do than to make sense of python's stupid design decisions. this language was created and will stay in hell forever
lmao i agree. no need to fix, i found a kinda solution (althought its kinda ugly) but thanks anyway
for example:
and then rename variables, it might look like this
basically renamer skips over a nonlocal