You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The pattern handling in StrRepr is a bit rubbish, dealing with trivial bases in int, and with no clue about floating-point representations. We should have the ability to derive a %-format from a cohort of strings (just as we do for DateTime) for the Int and Float classes.
The Int detection you already know how to do; Float can be figured out. The tricky bit will be handling __eq__ and __str__ for those patterns. The current base merging is easy enough, but handling 0-prefix and length padding may turn out to be non-trivial, e.g. it needs to know that '%08x' == '%10x' and that '%08x' + '%10x' == '%08x', that '%#x' != '%x', etc.
The text was updated successfully, but these errors were encountered:
The pattern handling in StrRepr is a bit rubbish, dealing with trivial bases in int, and with no clue about floating-point representations. We should have the ability to derive a %-format from a cohort of strings (just as we do for DateTime) for the Int and Float classes.
The Int detection you already know how to do; Float can be figured out. The tricky bit will be handling
__eq__
and__str__
for those patterns. The current base merging is easy enough, but handling 0-prefix and length padding may turn out to be non-trivial, e.g. it needs to know that'%08x' == '%10x'
and that'%08x' + '%10x' == '%08x'
, that'%#x' != '%x'
, etc.The text was updated successfully, but these errors were encountered: