-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Explore if the data model method __format__
could be of use
#127
Comments
@Batalex thanks for the suggestion.
At the time I found handling these multiple layers of options complicated. That said, I still don't think I've wrapped my head around the value of "late/lazy" formatting. I need to code up and test an implementation of #114 and then I think I'll have a better idea about this. |
@Batalex Actually, reading this again, I would say that this is already exactly covered by the combination of configuring global options + using the FSML on the
What is missing is (1) the ability to use a non-global formatter to format The reason I stopped pursuing the above approach is it's just a bit confusing to mentally keep track of 3 sets of formatting rules and their override behaviors: the global rules, the local formatter rules, and the FSML rules. I feel like using the global formatting + FSML rules to control @Batalex what do you think? |
The
This allows us to do
I think this is basically what you're suggesting. I'm trying to decide how I feel about it. It is really starting to blur the lines between the I'm trying to wrap my head around what workflows are going to be useful for users. In my mind I imagine something like:
It's hard for me to imagine users wanting repeated rounds of formatting of the same results, but my imagination is limited. My intuition is telling me there is probably an elegant way to combine the The thing I'm nervous about is that it can get confusing when there are a lot of different options running around. E.g. the global options, the option that were used to generate a |
I'm going to close this for now. I think global options and If there is interest in having some kind of round tripping behavior between |
Hey there,
I just thought of something that could complement #114.
You know how you can use https://docs.python.org/3/library/string.html#formatspec to change an object representation inside an f-string or a string template like this:
This behavior is defined by the
__format__
dunder method. Maybe this could be used insciform
to change a few formatting options on the fly, such as the decimal precision or the unit.The text was updated successfully, but these errors were encountered: