File: typed_dict.py

package info (click to toggle)
python-pdoc 16.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,080 kB
  • sloc: python: 5,260; javascript: 1,156; makefile: 18; sh: 3
file content (22 lines) | stat: -rw-r--r-- 371 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
from typing import TypedDict


class Foo(TypedDict):
    a: int | None
    """First attribute."""


class Bar(Foo, total=False):
    """A TypedDict subclass. Before 3.12, TypedDict botches __mro__."""

    b: int
    """Second attribute."""
    c: str
    # undocumented attribute


class Baz(Bar):
    """A TypedDict subsubclass."""

    d: bool
    """new attribute"""