-
Notifications
You must be signed in to change notification settings - Fork 443
Description
Issue Overview
toFile() method from 10_05_solution.py doesn't work with extended classes like PlotScribe
Describe your environment
toDict() for PlotScribe looks like this:{
'classname': 'PlotScribe',
'color': 'cyan',
'mark': '*',
'trail': '.',
'pos': (0, 0),
'moves': [
['_setDegrees', [135]],
['_plotX', [ < function sine at 0x7fc78a4aa4d0 > ]],
['_plotX', [ < function sine at 0x7fc78a4aa4d0 > ]],
['_plotX', [ < function sine at 0x7fc78a4aa4d0 > ]],
['_plotX', [ < function sine at 0x7fc78a4aa4d0 > ]],
['_plotX', [ < function sine at 0x7fc78a4aa4d0 > ]],
['_plotX', [ < function sine at 0x7fc78a4aa4d0 > ]],
['_plotX', [ < function sine at 0x7fc78a4aa4d0 > ]],
['_plotX', [ < function sine at 0x7fc78a4aa4d0 > ]],
['_plotX', [ < function sine at 0x7fc78a4aa4d0 > ]],
['_plotX', [ < function sine at 0x7fc78a4aa4d0 > ]],
['_plotX', [ < function sine at 0x7fc78a4aa4d0 > ]],
['_plotX', [ < function sine at 0x7fc78a4aa4d0 > ]],
['_plotX', [ < function sine at 0x7fc78a4aa4d0 > ]],
['_plotX', [ < function sine at 0x7fc78a4aa4d0 > ]],
['_plotX', [ < function sine at 0x7fc78a4aa4d0 > ]],
['_plotX', [ < function sine at 0x7fc78a4aa4d0 > ]],
['_plotX', [ < function sine at 0x7fc78a4aa4d0 > ]],
['_plotX', [ < function sine at 0x7fc78a4aa4d0 > ]],
['_plotX', [ < function sine at 0x7fc78a4aa4d0 > ]],
['_plotX', [ < function sine at 0x7fc78a4aa4d0 > ]],
['_plotX', [ < function sine at 0x7fc78a4aa4d0 > ]],
['_plotX', [ < function sine at 0x7fc78a4aa4d0 > ]],
['_plotX', [ < function sine at 0x7fc78a4aa4d0 > ]],
['_plotX', [ < function sine at 0x7fc78a4aa4d0 > ]],
['_plotX', [ < function sine at 0x7fc78a4aa4d0 > ]],
['_plotX', [ < function sine at 0x7fc78a4aa4d0 > ]],
['_plotX', [ < function sine at 0x7fc78a4aa4d0 > ]],
['_plotX', [ < function sine at 0x7fc78a4aa4d0 > ]],
['_plotX', [ < function sine at 0x7fc78a4aa4d0 > ]],
['_plotX', [ < function sine at 0x7fc78a4aa4d0 > ]]
],
'x': 0,
'domain': [0, 30]
}
Steps to Reproduce
- Added these lines to end of chapter solution:
scribe3 = PlotScribe(domain=[0, 30], color='cyan')
scribe3.plotX(sine)
canvas = CanvasAxis(30, 30, scribes=[scribe, robotScribe, scribe3])
canvas.toFile('solution_file')
2. $ python ./exercise_files/10_05_solution.py
Expected Behavior
Example code should work with example extended scribe class
Current Behavior
TypeError: Object of type function is not JSON serializable