File: collections_abc.py

package info (click to toggle)
python-pdoc 15.0.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,192 kB
  • sloc: python: 8,013; javascript: 1,156; makefile: 18; sh: 3
file content (21 lines) | stat: -rw-r--r-- 486 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
"""Test that we remove 'collections.abc' from type signatures."""

from collections.abc import Awaitable
from collections.abc import Container


def func(bar: Awaitable[None]) -> Awaitable[None]:
    return bar


class Class(Container[str]):
    """
    For subclasses, we currently display the full classname.
    Mostly because it's easier, but it also makes a bit more sense here.
    """

    def __contains__(self, item):
        return item == "Bar"


var: Container[str] = "baz"