Fixes issue #7480
This has been under development since April 2017. See #3034 and #6375. Signed-off-by: Damien George <damien@micropython.org>