Generator which leaves a placeholder at the beginning and at the end of the input iterator intact
问题 Let's take a list as an example: a = [255, 255, 1, 255, 255, 255, 1, 2, 255, 255, 2, 255, 255, 3, 255, 3, 255, 255, 255] 255 is a special value in it. It's a placeholder. I've made a generator which replaces some of the placeholder inside the list. It works as expected. But I need not to process the beginning placeholders [255, 255 and the ending placeholders 255, 255, 255] and yield them intact. So, I tried to modify the generator to work it out: Python 2.7 from __future__ import print