protocol-lib

Protocols for better structural typing


Keywords
hacktoberfest, python, typing
License
MIT
Install
pip install protocol-lib==1.0.0

Documentation

protocol-lib

Build

Protocols for better structural typing

Goals

Implement Protocols for:

  • Container
  • Hashable
  • Iterable
  • Iterator
  • Reversible
  • Generator
  • Sized
  • Callable
  • Collection
  • Sequence
  • MutableSequence
  • ByteString
  • Set
  • MutableSet
  • Mapping
  • MutableMapping
  • MappingView
  • ItemsView
  • KeysView
  • ValuesView
  • Awaitable
  • Coroutine
  • AsyncIterable
  • AsyncIterator
  • AsyncGenerator

Notes

Generator is not currently implemented in this library. This is due to challenges encountered when attempting to implement it.

Updating project config

To do this make edits to the .projenrc.js file in the root of the project and run npx projen to update existing or generate new config. Please also use npx prettier --trailing-comma all --write .projenrc.js to format this file.