title: What is the simplest way to create an empty iterable using yield in Python?
body: <p>I was playing around with iterables and more specifically the <code>yield</code> operator in Python. While using test driven development to start writing a new iterable, I wondered what is the shortest code that could make this simple test for an iterable to pass:</p>
  
  <pre class="lang-py prettyprint-override"><code>def test():
      for x in my_iterable():
          pass
  </code></pre>
  
  <p>The shortest version I could think of was:</p>
  
  <pre class="lang-py prettyprint-override"><code>def my_iterable():
      for i in []:
          yield i
  </code></pre>
  
  <p>Is it possible to write a simpler, shorter or more beautiful (pythonic) version?</p>