Mk `MsgDec.spec_str` have a more compact `

runtime_to_msgspec
Tyler Goodlet 2024-05-22 15:18:45 -04:00
parent c6f599b1be
commit ce4d64ed2f
1 changed files with 5 additions and 2 deletions

View File

@ -162,7 +162,10 @@ class MsgDec(Struct):
# TODO: would get moved into `FieldSpec.__str__()` right?
@property
def spec_str(self) -> str:
return pformat_msgspec(codec=self)
return pformat_msgspec(
codec=self,
join_char='|',
)
pld_spec_str = spec_str
@ -211,7 +214,7 @@ def mk_msgspec_table(
msgtypes = [msgspec]
msgt_table: dict[str, MsgType] = {
msgt: str(msgt)
msgt: str(msgt.__name__)
for msgt in msgtypes
}
if msg: