I've noticed that calling the method paper_repository_list() (and other methods with that follow the same structure). From what I've come to conclude, the problem is that in the return line return [Repository(**r) for r in self.http.get(f"/papers/{paper_id}/repositories/") ], the HTTP request returns a dict such as:
'next': None,
'previous': None,
'results': [{'url': 'https://github.com/andreev-io/Simulated-Annealing',
'is_official': False,
'description': 'Implementation of the 1983 Simulated Annealing paper (Kirkpatrick et al.) in Rust. Combinatorial optimization, traveling salesman.',
'stars': 1,
'framework': 'none'}]}
so looping with that only gives the keys of this dict, instead of the list of results. I believe that adding the key 'results' should fix the problem, as the list comprehension would be looping indeed with each list element (a dict):
return [Repository(**r) for r in self.http.get(f"/papers/{paper_id}/repositories/")["results"]]
I've noticed that calling the method paper_repository_list() (and other methods with that follow the same structure). From what I've come to conclude, the problem is that in the return line
return [Repository(**r) for r in self.http.get(f"/papers/{paper_id}/repositories/") ]
, the HTTP request returns a dict such as:so looping with that only gives the keys of this dict, instead of the list of results. I believe that adding the key 'results' should fix the problem, as the list comprehension would be looping indeed with each list element (a dict):
return [Repository(**r) for r in self.http.get(f"/papers/{paper_id}/repositories/")["results"]]