How can I identify whether or not a given function is:
- A closure function
- A nested function which isn't a closure
- Not a nested function
I know I can say len(function.__closure__) > 0
but this would only answer whether or not this is a closure. What about a non-closure nested function? And is there a better way to do this?
Aucun commentaire:
Enregistrer un commentaire