fix various __str__ and __repr__ implementations

This commit is contained in:
Shiz 2021-06-26 03:40:23 +02:00
parent e4c8f5430d
commit 3ee6afc669
3 changed files with 4 additions and 3 deletions

View File

@ -269,7 +269,7 @@ class ProxyExpr(G[T], Expr[T]):
return put(self.__source, value, pop=pop)
def __str__(self) -> str:
return f'${self.__name}:{self.__source}'
return f'${self.__name}'
def __repr__(self) -> str:
return f'${self.__name}(=> {self.__source!r})'

View File

@ -120,7 +120,7 @@ class Arr(G[T], Type[List[T]]):
def __str__(self) -> str:
if self.count is not None:
count = repr(self.count)
count = str(self.count)
else:
count = ''
return f'{self.child}[{count}]'

View File

@ -192,8 +192,9 @@ class Mapped(G[T, V], Transform[T, V]):
super().__init__(child,
parse=mapping.__getitem__,
dump=reverse.__getitem__,
context=False,
str=str or f'{mapping}[{child}]',
repr=repr or f'<{__name__}.Mapped({child!r}, {mapping!r})>'
repr=repr or f'{__name__}.Mapped({child!r}, {mapping!r})'
)