[docs] [issue34094] Porting Python 2 to Python 3 example contradicts its own advice