Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python class overwrite length method

class Liar(list):
    def __len__(self, items):
        real_length= super().__len__(items)
        return real_length+=3
Source by teamtreehouse.com #
 
PREVIOUS NEXT
Tagged: #python #class #overwrite #length #method
ADD COMMENT
Topic
Name
2+1 =