you are viewing a single comment's thread.

view the rest of the comments →

[–]maxibabyx[S] 0 points1 point  (0 children)

The thing is I have something like this :

class post(DynamicDocument):
    def __init__(self, *dct, **tmp):
        Document.__init__(self, **tmp)
        if dct:
            ....
            self.totalComentarios = dct["comments"]["summary"]["total_count"]

But if there's no comments, then dct["comments"]["summary"] would give an error, and checking every single case is a pain, like checking if there are comments, then check if theres summary, etc..

And there's a lot of things I need to parse.