Content deleted Content added
m Task 70: Update syntaxhighlight tags - remove use of deprecated <source> tags |
|||
Line 161:
Please avoid using irrelevant concepts in the examples. For example, the python example on this page was,
<
>>> def my_square(val):
... """ the callback """
Line 178:
3 ** 2 = 9
4 ** 2 = 16
</syntaxhighlight>
Why should we assume that the reader knows
Line 186:
I have since changed the above to:
<
>>> def get_square(val):
... """ the callback """
Line 196:
>>> caller(get_square, 5)
25
</syntaxhighlight>
'''Caveat''': The example is complex because it demonstrates how callbacks can be implemented to achieve some complex behaviour; however, the program written to demonstrate this still should not include ''unnecessary'' concepts and be as simplistic as possible.
|