fix various __str__ and __repr__ implementations
This commit is contained in:
parent
e4c8f5430d
commit
3ee6afc669
|
@ -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})'
|
||||
|
|
|
@ -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}]'
|
||||
|
|
|
@ -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})'
|
||||
)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue