Skip to content
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

Unclear that Jobs.load() returns a dictionary. #298

Open
multimeric opened this issue May 29, 2023 · 2 comments
Open

Unclear that Jobs.load() returns a dictionary. #298

multimeric opened this issue May 29, 2023 · 2 comments

Comments

@multimeric
Copy link
Contributor

I'm testing out the new API. It seems that Jobs.load() returns a dict[int, Job] whose keys are the job IDs. However this isn't explained in the docs. This is a change from the previous API which returned some kind of list-type iterable (I forget what).

@tazend
Copy link
Member

tazend commented May 29, 2023

Hi,

the Jobs class basically inherits from dict, and Jobs.load() returns a new instance of a Jobs collection that contains all the jobs in the system at the moment of calling.
The documentation only says that the Jobs class inherits from dict (Bases: dict at the top) and contains Job objects, so I agree that it might not be entirely clear that the keys of this dict are the job ids.

I will try to make it more clear in the docs that the Jobs collection inherits from dict and basically has the form of dict[int, Job], where the keys are the job-ids. Would that be good?

@multimeric
Copy link
Contributor Author

Okay that's a fair point, there is technically the right information there already. I think it's hindered by the fact that my IDE has no idea what fields these classes have. But the information you mention would be a good addition.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants