Skip to content

Instantly share code, notes, and snippets.

@justinchuby
Last active May 15, 2022 16:05
Show Gist options
  • Save justinchuby/4021cebe9e093f636759a88de325c85f to your computer and use it in GitHub Desktop.
Save justinchuby/4021cebe9e093f636759a88de325c85f to your computer and use it in GitHub Desktop.
Python container typing hierarchy

Python container typing hierarchy

Including collections abstract base classes

classDiagram
    AbstractSet <-- FrozenSet
    AbstractSet <-- KeysView
    AbstractSet <-- MutableSet
    MutableSet <-- Set
    AsyncIterable <-- AsyncIterator
    AsyncIterator <-- AsyncGenerator
    Collection <-- AbstractSet
    Collection <-- Mapping
    Collection <-- Sequence
    Dict <-- Counter
    Iterable <-- Collection
    Iterable <-- Reversible
    Iterable <-- Iterator
    Iterator <-- Generator
    Mapping <-- MutableMapping
    MutableMapping <-- Dict
    MutableMapping <-- ChainMap
    MutableMapping <-- DefaultDict
    MutableSequence <-- Deque
    MutableSequence <-- List
    Reversible <-- Sequence
    Sequence <-- str
    Sequence <-- Tuple
    Sequence <-- ByteString
    Sequence <-- MutableSequence
    Sized <-- AbstractSet
    Sized <-- Collection
    Sized <-- Mapping
    Container <-- Collection

References

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment