8000 `TypeAdapter` repr modification - use parens not brackets (#10880) · pydantic/pydantic@30ee4f4 · GitHub
[go: up one dir, main page]

Skip to content

Commit 30ee4f4

Browse files
TypeAdapter repr modification - use parens not brackets (#10880)
1 parent 0c56942 commit 30ee4f4

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

pydantic/type_adapter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ def _model_config(self) -> ConfigDict | None:
314314
return getattr(type_, '__pydantic_config__', None)
315315

316316
def __repr__(self) -> str:
317-
return f'TypeAdapter[{_repr.display_as_type(self._type)}]'
317+
return f'TypeAdapter({_repr.display_as_type(self._type)})'
318318

319319
def rebuild(
320320
self,

tests/test_type_adapter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -591,4 +591,4 @@ class SimpleDataclass:
591591
@pytest.mark.parametrize('type_,repr_', [(int, 'int'), (List[int], 'List[int]'), (SimpleDataclass, 'SimpleDataclass')])
592592
def test_ta_repr(type_: Any, repr_: str) -> None:
593593
ta = TypeAdapter(type_)
594-
assert repr(ta) == f'TypeAdapter[{repr_}]'
594+
assert repr(ta) == f'TypeAdapter({repr_})'

0 commit comments

Comments
 (0)
0