1#!/usr/bin/env python3
2"""
3
4"""
5
6# Imports:
7from __future__ import annotations
8
9# ##-- stdlib imports
10import datetime
11import enum
12import functools as ftz
13import itertools as itz
14import logging as logmod
15import pathlib as pl
16import re
17import string
18import time
19import types
20import weakref
21from uuid import UUID, uuid1
22
23# ##-- end stdlib imports
24
25# ##-- 1st party imports
26from jgdv._abstract.protocols.general import Buildable_p, SpecStruct_p
27from jgdv.structs.strang import CodeReference
28
29# ##-- end 1st party imports
30
31from .._interface import DKeyMark_e
32from ..dkey import DKey
33from ..keys import MultiDKey, NonDKey, SingleDKey
34
35# ##-- types
36# isort: off
37import abc
38import collections.abc
39from typing import TYPE_CHECKING, Generic, cast, assert_type, assert_never
40# Protocols:
41from typing import Protocol, runtime_checkable
42# Typing Decorators:
43from typing import no_type_check, final, override, overload
44
45if TYPE_CHECKING:
46 from jgdv import Maybe, Ident, RxStr, Rx
47 from typing import Final
48 from typing import ClassVar, Any, LiteralString
49 from typing import Never, Self, Literal
50 from typing import TypeGuard
51 from collections.abc import Iterable, Iterator, Callable, Generator
52 from collections.abc import Sequence, Mapping, MutableMapping, Hashable
53
54# isort: on
55# ##-- end types
56
57##-- logging
58logging = logmod.getLogger(__name__)
59##-- end logging
60
[docs]
61class ImportDKey(DKey, mark=CodeReference, convert="c"):
62 """
63 Subclass for dkey's which expand to CodeReferences
64 """
65 __slots__ = ()
66
67 def __init__(self, *args, **kwargs):
68 super().__init__(*args, **kwargs)
69 self.data.expansion_type = CodeReference
70 self.data.typecheck = CodeReference