Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Because fib is recursive, pretty sure you will only get one printout, not one for each call to fib.


As it is here, yeah, only once at the root level. But if you were to use it as a decorator on the original function, and reassign to the original name (as the decorator syntax does), it would print at every level, as the recursive call would bind to the decorated function.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: