# Change Summary

Support strict specification for UUID types

Fix #7838

## Checklist

* [x] The pull request title is a good summary of the changes - it will be used in the changelog
* [x] Unit tests for the changes exist
* [x] Tests pass on CI
* [ ] Documentation reflects the changes where applicable
* [x] My PR is ready to review, **please add a comment including the phrase "please review" to assign reviewers**

Support strict specification for UUID types. # Change Summary

Support strict specification for UUID types

Fix #7838

## Checklist

* [x] The pull request title is a good summary of the changes - it will be used in the changelog
* [x] Unit tests for the changes exist
* [x] Tests pass on CI
* [ ] Documentation reflects the changes where applicable
* [x] My PR is ready to review, **please add a comment including the phrase "please review" to assign reviewers**

"""
See https://github.com/pydantic/pydantic/issues/4457
"""

from typing import Dict, List

from pydantic import BaseModel, Field


def new_list() -> List[int]:
    return []


class Model(BaseModel):
    l1: List[str] = Field(default_factory=list)
    l2: List[int] = Field(default_factory=new_list)
    l3: List[str] = Field(default_factory=lambda: list())
    l4: Dict[str, str] = Field(default_factory=dict)
    l5: int = Field(default_factory=lambda: 123)
    l6_error: List[str] = Field(default_factory=new_list)
    l7_error: int = Field(default_factory=list)

"""
See https://github.com/pydantic/pydantic/issues/4457
"""

from typing import Dict, List

from pydantic import BaseModel, Field


def new_list() -> List[int]:
    return []


class Model(BaseModel):
    l1: List[str] = Field(default_factory=list)
    l2: List[int] = Field(default_factory=new_list)
    l3: List[str] = Field(default_factory=lambda: list())
    l4: Dict[str, str] = Field(default_factory=dict)
    l5: int = Field(default_factory=lambda: 123)
    l6_error: List[str] = Field(default_factory=new_list)
    l7_error: int = Field(default_factory=list)
