About 102,000 results
Open links in new tab
  1. Generics — typing documentation

    Generics ¶ You may have seen type hints like list [str] or dict [str, int] in Python code. These types are interesting in that they are …

  2. Generics — typing documentation

    This is equivalent to omitting the generic notation and just saying elements: list. User-defined generic types ¶ There are several ways …

  3. Python Generics - GeeksforGeeks

    Oct 29, 2025 · Python Generics Example Below, are examples of Python Generics in Python. Example 1: Python Generics with …

  4. The Complete Guide to Python Generics: From Beginner to Pro

    Aug 26, 2025 · Python Generics might sound intimidating, but they’re actually one of the most powerful features for writing clean, …

  5. typing — Support for type hints — Python 3.14.7 documentation

    3 days ago · Generic functions and classes can be parameterized by using type parameter syntax: ... Or by using the TypeVar …

  6. Generics - mypy 2.3.1 documentation

    There are two syntax variants for defining generic classes in Python. Python 3.12 introduced a new dedicated syntax for defining …

  7. Python - Generics - Online Tutorials Library

    In Python, generics is a mechanism with which you to define functions, classes, or methods that can operate on multiple types while …

  8. Using Generics in Python. If you are using type hints in ... - Medium

    Jul 21, 2021 · If you are using type hints in Python and static analysis tools such as mypy, then you have probably used the Any type …

  9. Python 3.12 Generics: Cleaner, Easier Type-Hinting - ArjanCodes

    Jun 6, 2024 · Learn how Python 3.12 generics make type-hinting easier and clearer. Use the new syntax to enhance your code's …

  10. Python Generic Types: A Comprehensive Guide - CodeRivers

    Feb 22, 2026 · Python is a dynamic, strongly-typed language. While it has always been possible to write code that works with …