def add_comment(self, post=None, name=None, email=None, pub_date=None,
                    website=None, body=None):
        """
        Adds a comment to the post provided.
        """
        if post is None:
            if not self.posts:
                raise CommandError("Cannot add comments without posts")
            post = self.posts[-1]
        post["comments"].append({
            "user_name": name,
            "user_email": email,
            "submit_date": pub_date,
            "user_url": website,
            "comment": body,
        })
def add_comment ( self , post = None , name = None , email = None , pub_date = None , website = None , body = None ) : if post is None : if not self . posts : raise CommandError ( "Cannot add comments without posts" ) post = self . posts [ - 1 ] post [ "comments" ] . append ( { "user_name" : name , "user_email" : email , "submit_date" : pub_date , "user_url" : website , "comment" : body , } )
Adds a comment to the post provided.