3 ms·
I've used a couple of times for high-order functions. For example, I was playing around with sound generation and decided to create a 'stream' object. Instances
by gizmo686 13y ago
I've used a couple of times for high-order functions. For example, I was playing around with sound generation and decided to create a 'stream' object. Instances of this object were defined by a function that generates the sound wave. This meant that the constructor took a parameter a somewhat generic function. I also found that some of my generator functions could take arguments themselves, such as pitch. Having args and *kwargs allows you to pass these arbitrary variables through.