# This is a pattern file used to rewrite generated stubs

# Remove an entry
remove_me:

# Change a function signature, keep the documentation
tweak_me:
    def tweak_me(arg: int):
        \doc

# Rewrite a signature with whole-module imports (both plain and with 'as' name)
import_me:
    \import logging
    \import collections.abc as cabc
    def import_me(arg: logging.Logger) -> cabc.Iterable[int]: ...

# Respell an overload chain, each '\doc' takes the matching overload's docstring
overload_me:
    \from typing import overload
    @overload
    def overload_me(arg: int) -> None:
        \doc

    @overload
    def overload_me(arg: str) -> None:
        \doc

# Collapse an overload chain, a single '\doc' falls back to the first docstring
collapse_me:
    def collapse_me(arg: int | str) -> None:
        \doc

# Apply a pattern to multiple places. Each match leaves one alternation group
# without a value, and its reference substitutes as an empty string.
__(?:(lt)|(gt))__:
    def __\1\2__(self, arg: int, /) -> bool: ...

test_typing_ext.__prefix__:
    # a prefix

test_typing_ext.__suffix__:
    # a suffix

test_typing_ext.Foo.__prefix__:
    # a class prefix

test_typing_ext.Foo.__suffix__:
    # a class suffix
