Skip to content

Commit

Permalink
use config dict
Browse files Browse the repository at this point in the history
  • Loading branch information
tlambert03 committed Jul 6, 2024
1 parent 8e7b8c0 commit 21527b1
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions src/useq/_base_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,9 @@
)

import numpy as np
from pydantic import BaseModel
from pydantic import BaseModel, ConfigDict

if TYPE_CHECKING:
from pydantic import ConfigDict

ReprArgs = Sequence[Tuple[Optional[str], Any]]

__all__ = ["UseqModel", "FrozenModel"]
Expand All @@ -28,12 +26,12 @@


class FrozenModel(BaseModel):
model_config: ClassVar["ConfigDict"] = {
"populate_by_name": True,
"extra": "ignore",
"frozen": True,
"json_encoders": {MappingProxyType: dict},
}
model_config: ClassVar["ConfigDict"] = ConfigDict(
populate_by_name=True,
extra="ignore",
frozen=True,
json_encoders={MappingProxyType: dict},
)

def replace(self: _T, **kwargs: Any) -> _T:
"""Return a new instance replacing specified kwargs with new values.
Expand Down

0 comments on commit 21527b1

Please sign in to comment.