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
It's cute that tools.time.seconds_to_human() takes care of the future/past grammar for you (adding "in " to the front or " ago" to the back, depending on the delta's sign). But it makes using that function really annoying in some cases, when it should be the perfect tool.
For the use cases I'm looking at, the most useful thing would be a "raw" mode that returns the intermediate list of units, rather than the fully-formatted string. In implementing this, we could actually simplify the code around here and eliminate the split(', ') below it:
Related: #1798, #1799. Not all of these will necessarily be implemented. Right now they're all just ideas, and picking the right one or two could make the API flexible and intuitive enough that we don't need to bake every little feature into it.
The text was updated successfully, but these errors were encountered:
This actually should be low-hanging fruit, and I'll self-assign it for the last two weeks of Hacktoberfest to (hopefully) motivate myself to take care of it.
It's cute that
tools.time.seconds_to_human()
takes care of the future/past grammar for you (adding "in " to the front or " ago" to the back, depending on the delta's sign). But it makes using that function really annoying in some cases, when it should be the perfect tool.For the use cases I'm looking at, the most useful thing would be a "raw" mode that returns the intermediate list of units, rather than the fully-formatted string. In implementing this, we could actually simplify the code around here and eliminate the
split(', ')
below it:sopel/sopel/tools/time.py
Lines 243 to 250 in 3959137
Related: #1798, #1799. Not all of these will necessarily be implemented. Right now they're all just ideas, and picking the right one or two could make the API flexible and intuitive enough that we don't need to bake every little feature into it.
The text was updated successfully, but these errors were encountered: