collections_abc API documentation

# collections_abc

Test that we remove 'collections.abc' from type signatures.

View Source

     1"""Test that we remove 'collections.abc' from type signatures."""
     2
     3from collections.abc import Awaitable
     4from collections.abc import Container
     5
     6
     7def func(bar: Awaitable[None]) -> Awaitable[None]:
     8    return bar
     9
    10
    11class Class(Container[str]):
    12    """
    13    For subclasses, we currently display the full classname.
    14    Mostly because it's easier, but it also makes a bit more sense here.
    15    """
    16
    17    def __contains__(self, item):
    18        return item == "Bar"
    19
    20
    21var: Container[str] = "baz"

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

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

class Class(collections.abc.Container[str]): View Source

    12class Class(Container[str]):
    13    """
    14    For subclasses, we currently display the full classname.
    15    Mostly because it's easier, but it also makes a bit more sense here.
    16    """
    17
    18    def __contains__(self, item):
    19        return item == "Bar"

For subclasses, we currently display the full classname. Mostly because it's easier, but it also makes a bit more sense here.

var: Container[str] = 'baz'