title: How to give a Pydantic list field a default value?
body: <p>I want to create a Pydantic model in which there is a list field, which left uninitialized has a default value of an empty list. Is there an idiomatic way to do this?</p>
  <p>For Python's built-in dataclass objects you can use <code>field(default_factory=list)</code>, however in my own experiments this seems to prevent my Pydantic models from being pickled. A naive implementation might be, something like this:</p>
  <pre><code>from pydantic import BaseModel
  
  class Foo(BaseModel):
      defaulted_list_field: Sequence[str] = [] # Bad!
  </code></pre>
  <p>But we all know not to use a mutable value like the empty-list literal as a default.</p>
  <p>So what's the correct way to give a Pydantic list-field a default value?</p>