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

Scout Monitoring - Free Django app performance insights with Scout Monitoring
Get Scout setup in minutes, and let us sweat the small stuff. A couple lines in settings.py is all you need to start monitoring your apps. Sign up for our free tier today.
www.scoutapm.com
featured
InfluxDB - Purpose built for real-time analytics at any scale.
InfluxDB Platform is powered by columnar analytics, optimized for cost-efficient storage, and built with open data standards.
www.influxdata.com
featured
  • typing

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

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

  • Scout Monitoring

    Free Django app performance insights with Scout Monitoring. Get Scout setup in minutes, and let us sweat the small stuff. A couple lines in settings.py is all you need to start monitoring your apps. Sign up for our free tier today.

    Scout Monitoring logo
  • 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).

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

  • JSON extra uses orjson instead of ujson

    4 projects | news.ycombinator.com | 5 Jun 2024
  • utype VS pydantic - a user suggested alternative

    2 projects | 15 Feb 2024
  • How I saved Business logic from Telegram integration

    3 projects | dev.to | 23 Dec 2022
  • pydantic VS marshmallow - a user suggested alternative

    2 projects | 21 Sep 2022
  • Python Type Hints Are Turing Complete

    9 projects | news.ycombinator.com | 9 Sep 2022