Source code for tables.link

"""Create links in the HDF5 file.

This module implements containers for soft and external links.  Hard
links doesn't need a container as such as they are the same as regular
nodes (groups or leaves).

Classes:

    SoftLink
    ExternalLink

Functions:

Misc variables:

"""

from pathlib import Path
from typing import Any, Literal, NoReturn, Optional, TYPE_CHECKING

import tables as tb

from . import linkextension
from .node import Node
from .utils import lazyattr
from .attributeset import AttributeSet

if TYPE_CHECKING:
    from .group import Group


def _g_get_link_class(parent_id: int,
                      name: str) -> Literal["ExternalLink", "HardLink", "SoftLink", "UnImplemented"]:
    """Guess the link class."""

    return linkextension._get_link_class(parent_id, name)