view mercurial/interfaces/types.py @ 52767:ae2848198462

typing: add annotation to the public API of the transaction This prepare official protocol for the transaction (itself motivated by breaking the import cycle that slow pytype run to a crawl).
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Fri, 07 Feb 2025 16:40:49 +0100
parents 4eede65d68cf
children a7dcb7c1ff5a
line wrap: on
line source

# mercurial/interfaces/types.py - type alias for interfaces
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
#
# This is the main entry point for Mercurial code writing type annotations.
#
# The general principle can be summarized when dealing with <FooBar> object:
# - to type your code: use FooBarT from `mercurial.interface.types`
# - to subclass <FooBar>: use IFooBar from `mercurial.interface.foo_bar`

from __future__ import annotations

from ._basetypes import (  # noqa: F401 (ignore imported but not used)
    CallbackCategoryT,
    FsPathT,
    HgPathT,
    UserMsgT,
    VfsKeyT,
)

from . import (
    matcher,
)

MatcherT = matcher.IMatcher