Repository: konradhalas/dacite

Issue:
Incorrect work when using field with default_factory
**Describe the bug**
`default_factory` is called only once if a field absent in the data

**To Reproduce**
```python
#!/usr/bin/env python

from dataclasses import field, dataclass

from dacite import from_dict


@dataclass
class A:
    name: str
    items: list[str] = field(default_factory=list)


if __name__ == '__main__':
    a1 = from_dict(A, {'name': 'a1'})
    a2 = from_dict(A, {'name': 'a2'})
    print('Test identity:', a1.items is a2.items)
```
**Output**
```
Test identity: True
```

**Expected behavior**
`items` shouldn't be identical.
`dacite v1.7.0` works as expected
```
Test identity: False
```

**Environment**
- Python version: 3.9.16
- `dacite` version: 1.8.0



Discussion:

Patch:
diff --git a/dacite/dataclasses.py b/dacite/dataclasses.py
index d70f423..c06ddc0 100644
--- a/dacite/dataclasses.py
+++ b/dacite/dataclasses.py
@@ -11,7 +11,6 @@ class DefaultValueNotFoundError(Exception):
     pass
 
 
-@cache
 def get_default_value_for_field(field: Field, type_: Type) -> Any:
     if field.default != MISSING:
         return field.default


Test patch:
diff --git a/tests/core/test_base.py b/tests/core/test_base.py
index 8d82788..a866d57 100644
--- a/tests/core/test_base.py
+++ b/tests/core/test_base.py
@@ -1,5 +1,5 @@
 from dataclasses import dataclass, field
-from typing import Any, NewType, Optional
+from typing import Any, NewType, Optional, List
 
 import pytest
 
@@ -191,3 +191,16 @@ def test_from_dict_with_new_type():
     result = from_dict(X, {"s": "test"})
 
     assert result == X(s=MyStr("test"))
+
+
+def test_dataclass_default_factory_identity():
+    # https://github.com/konradhalas/dacite/issues/215
+    @dataclass
+    class A:
+        name: str
+        items: List[str] = field(default_factory=list)
+
+    a1 = from_dict(A, {"name": "a1"})
+    a2 = from_dict(A, {"name": "a2"})
+
+    assert a1.items is not a2.items