title: Repeated fields return AttributeError - type object 'Foo' has no attribute 'nums'
body: <p>I am following <a href="https://developers.google.com/protocol-buffers/docs/reference/python-generated#repeated-fields" rel="nofollow noreferrer">this tutorial</a> for using protocol buffers in <code>python</code>. </p>
  
  <p>Here is my <code>main.proto</code> file:</p>
  
  <pre><code>syntax = "proto2"
  message Foo {
      repeated int32 nums = 1;
  }
  </code></pre>
  
  <p>I cannot access <code>foo.nums</code>.</p>
  
  <p>Here is the <code>python</code> script which fails:</p>
  
  <pre><code>import main_pb2
  foo = main_pb2.Foo
  foo.nums.append(1)
  </code></pre>
  
  <p>This is what I get when I run it:</p>
  
  <pre><code>AttributeError: type object 'Foo' has no attribute 'nums'.
  </code></pre>
  
  <p>To make it even more confusing, I can see that <code>Foo</code> has an attribute called <code>foo.NUMS_FIELD_NUMBER</code>. What is going on?</p>