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
Currently if I do a timed.tasks.get() I get greeted with a dict of many values.
If I want to get the ID of the associated task I'd have to do the following:
gianklug
changed the title
feat: Make everything an Object instead of
feat: Make everything an Object instead of a dict
Aug 1, 2023
gianklug
changed the title
feat: Make everything an Object instead of a dict
feat: Make everything an object instead of a dict
Aug 1, 2023
gianklug
changed the title
feat: Make everything an object instead of a dict
feat: Make everything an object of a custom class instead of a dict
Aug 1, 2023
Currently if I do a
timed.tasks.get()
I get greeted with a dict of many values.If I want to get the ID of the associated task I'd have to do the following:
This isn't very readable and clutters the codebase of end-user applications like timedctl.
My approach would be the following (code example):
basically we also want a class for the singular version of each datatype;
Task
forTasks
, etc.This way we have a much cleaner code base and an easier development flow as people don't have to look at the raw dicts that the API would return.
However, to maintain backwards compatibility we also need the
__dict__
method of each object to still return the dict how it used to be.The text was updated successfully, but these errors were encountered: