3 ms·
Python already has a solution for callbacks: @reg_callback(button.onclick) def callback(): do_stuff()
by anewaccountname 18y ago
Python already has a solution for callbacks:
@reg_callback(button.onclick)
def callback():
do_stuff()
- jamongkad 18y agoWhilst this is more pythonic I personally prefer Javascripts use of lambdas as more than a means of expression. More like a way of life for the language :-) And that is IMHO what makes it functionally closer to Scheme. Just looking at the way one defines lambdas in Javascript and their use throughout the language is a thing of beauty.