6 Matching Annotations
  1. Jan 2023
    1. Here's my opinion, having written many thousands of lines of mypy code.

      Negative opinion on mypy (see below this annotation)

  2. Oct 2021
    1. TypedDict is a dictionary whose keys are always string, and values are of the specified type. At runtime, it behaves exactly like a normal dictionary.

      TypedDict

    2. you should only use reveal_type to debug your code, and remove it when you’re done debugging.

      Because it's only used by mypy

    3. What this says is “function double takes an argument n which is an int, and the function returns an int.

      def double(n: int) -> int:

    4. This tells mypy that nums should be a list of integers (List[int]), and that average returns a float.
      from typing import List
      
      def average(nums: List[int]) -> float:
      
    5. for starters, use mypy --strict filename.py

      If you're starting your journey with mypy, use the --strict flag