intficpy/thing_base.py
def contains_desc(self):
        """
        Describe the contents of an item
        """
        if not self.contains:
            return ""

        desc = (
            f"{self.contains_preposition.capitalize()} {self.lowNameArticle(True)} is "
        )
        item_phrases = []
        # filter out composite child items
        contains = {
            ix: sublist
            for ix, sublist in self.contains.items()
            if not (sublist[0].parent_obj and sublist[0].parent_obj.ix in self.contains)
        }
        for key, sublist in contains.items():
            item_phrases.append(
                sublist[0].lowNameArticle()
                if len(sublist) == 1
                else (str(len(sublist)) + sublist[0].plural)
            )

        item_phrases[-1] += ". "

        if len(item_phrases) > 1:
            for i in range(0, len(item_phrases) - 2):
                item_phrases[i] += ","
            item_phrases[-2] += " and"

        return desc + " ".join(item_phrases)

        Describe the contents of an item
        
Describe the contents of an item
Describe the contents of an item
def contains_desc(self):
        if not self.contains:
            return ""
        desc = (
            f"{self.contains_preposition.capitalize()} {self.lowNameArticle(True)} is "
        )
        item_phrases = []
        contains = {
            ix: sublist
            for ix, sublist in self.contains.items()
            if not (sublist[0].parent_obj and sublist[0].parent_obj.ix in self.contains)
        }
        for key, sublist in contains.items():
            item_phrases.append(
                sublist[0].lowNameArticle()
                if len(sublist) == 1
                else (str(len(sublist)) + sublist[0].plural)
            )
        item_phrases[-1] += ". "
        if len(item_phrases) > 1:
            for i in range(0, len(item_phrases) - 2):
                item_phrases[i] += ","
            item_phrases[-2] += " and"
        return desc + " ".join(item_phrases)
def contains_desc ( self ) : if not self . contains : return "" desc = ( f"{self.contains_preposition.capitalize()} {self.lowNameArticle(True)} is " ) item_phrases = [ ] contains = { ix : sublist for ix , sublist in self . contains . items ( ) if not ( sublist [ 0 ] . parent_obj and sublist [ 0 ] . parent_obj . ix in self . contains ) } for key , sublist in contains . items ( ) : item_phrases . append ( sublist [ 0 ] . lowNameArticle ( ) if len ( sublist ) == 1 else ( str ( len ( sublist ) ) + sublist [ 0 ] . plural ) ) item_phrases [ - 1 ] += ". " if len ( item_phrases ) > 1 : for i in range ( 0 , len ( item_phrases ) - 2 ) : item_phrases [ i ] += "," item_phrases [ - 2 ] += " and" return desc + " " . join ( item_phrases )
Describe the contents of an item
Describe the contents of an item
"""
        Describe the contents of an item
        """ # filter out composite child items
self