What type hint should I use for "some container type" in general but explicitly exclude the str type?

This page summarizes the projects mentioned and recommended in the original post on /r/learnpython

Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
  • typing

    Python static typing home. Hosts the documentation and a user help forum.

  • See https://github.com/python/typing/issues/256 for a discussion.

  • pydantic

    Data validation using Python type hints

  • Indeed. Currently, Python type hinting cannot exclude types, and, of course, does not enforce anything at runtime anyway - although a library like pydantic can be used to enforce them at runtime (hence its popularity with packages like FastAPI).

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts