A custom class with a __len__ method will be good enough. It can return whatever you want and calling
len(instance)
could return the number of words, bytes, bits, rows, tables, stars, threes, people, cats, dogs, etc.