@startuml
'figure 1: Iterator Abstraction'
left to right direction
skinparam monochrome true
skinparam handwritten false
skinparam shadowing false
hide class circle

class Collection {
    __contains__()
    __iter__()
    __len__()
}

class Sized {
  __len__()
}

class Iterable {
  __iter__()
}

class Container {
  __contains__()
}

class Sequence {
    index()
    count()
}

class list {
    append()
    extend()
    pop()
    remove()
}

class Iterator {
    __next__()
    __iter__()
}

Container <|-- Collection
Sized <|-- Collection
Iterable <|-- Collection

Collection <|-- Sequence

Sequence <|-- list

Iterable::__iter__ ..> Iterator : "creates"
Iterable <|-- Iterator
@enduml
