jgdv.structs.dkey._interface
Type Aliases
Protocols
Base class for protocol classes. |
|
The protocol for a Key, something that used in a template system |
|
Base class for protocol classes. |
|
Base class for protocol classes. |
Classes
Enum where members are also (and must be) strings |
|
Enums for how to use/build a dkey |
|
Data of a DKey |
|
Utility class for parsed {}-format string parameters. |
Module Contents
- jgdv.structs.dkey._interface.LitFalse: TypeAlias = Literal[False]
- class jgdv.structs.dkey._interface.IndirectKey_p[source]
Bases:
ProtocolBase class for protocol classes.
Protocol classes are defined as:
class Proto(Protocol): def meth(self) -> int: ...
Such classes are primarily used with static type checkers that recognize structural subtyping (static duck-typing).
For example:
class C: def meth(self) -> int: return 0 def func(x: Proto) -> int: return x.meth() func(C()) # Passes static type check
See PEP 544 for details. Protocol classes decorated with @typing.runtime_checkable act as simple-minded runtime protocols that check only the presence of given attributes, ignoring their type signatures. Protocol classes can be generic, they are defined as:
class GenProto[T](Protocol): def meth(self) -> T: ...
- class jgdv.structs.dkey._interface.Key_p[source]
Bases:
jgdv.structs.strang._interface.Strang_p,ProtocolThe protocol for a Key, something that used in a template system
- static MarkOf(cls) <Unknown>[source]
- Parameters:
cls (type[Key_p.MarkOf.T] | Key_p.MarkOf.T)
- Return type:
KeyMark
- expand(
- *sources,
- rec=False,
- insist=False,
- chain=None,
- on_fail=Any,
- locs=None,
- **kwargs,
- Parameters:
locs (jgdv.Maybe[collections.abc.Mapping])
- Return type:
- _expander: ClassVar[jgdv.structs.dkey._util._interface.Expander_p]
- _processor: ClassVar
- class jgdv.structs.dkey._interface.MultiKey_p[source]
Bases:
ProtocolBase class for protocol classes.
Protocol classes are defined as:
class Proto(Protocol): def meth(self) -> int: ...
Such classes are primarily used with static type checkers that recognize structural subtyping (static duck-typing).
For example:
class C: def meth(self) -> int: return 0 def func(x: Proto) -> int: return x.meth() func(C()) # Passes static type check
See PEP 544 for details. Protocol classes decorated with @typing.runtime_checkable act as simple-minded runtime protocols that check only the presence of given attributes, ignoring their type signatures. Protocol classes can be generic, they are defined as:
class GenProto[T](Protocol): def meth(self) -> T: ...
- class jgdv.structs.dkey._interface.NonKey_p[source]
Bases:
ProtocolBase class for protocol classes.
Protocol classes are defined as:
class Proto(Protocol): def meth(self) -> int: ...
Such classes are primarily used with static type checkers that recognize structural subtyping (static duck-typing).
For example:
class C: def meth(self) -> int: return 0 def func(x: Proto) -> int: return x.meth() func(C()) # Passes static type check
See PEP 544 for details. Protocol classes decorated with @typing.runtime_checkable act as simple-minded runtime protocols that check only the presence of given attributes, ignoring their type signatures. Protocol classes can be generic, they are defined as:
class GenProto[T](Protocol): def meth(self) -> T: ...
- class jgdv.structs.dkey._interface.DKeyMarkAbstract_e[source]
Bases:
jgdv.structs.strang._interface.StrangMarkAbstract_eEnum where members are also (and must be) strings
- class jgdv.structs.dkey._interface.DKeyMark_e[source]
Bases:
DKeyMarkAbstract_eEnums for how to use/build a dkey
- ARGS
- KWARGS
- POSTBOX
- class jgdv.structs.dkey._interface.DKey_d(**kwargs)[source]
Bases:
jgdv.structs.strang._interface.Strang_dData of a DKey
- convert: jgdv.Maybe[jgdv.FmtStr]
- expansion_type: jgdv.Ctor
- fallback: jgdv.Maybe[Any]
- format: jgdv.Maybe[jgdv.FmtStr]
- typecheck: jgdv.CHECKTYPE
- class jgdv.structs.dkey._interface.RawKey_d(**kwargs)[source]
Utility class for parsed {}-format string parameters.
see: https://peps.python.org/pep-3101/ and: https://docs.python.org/3/library/string.html#format-string-syntax
Provides the data from string.Formatter.parse, but in a structure instead of a tuple.
- anon() <Unknown>[source]
Make a format str of this key, with anon variables.
eg: blah {key:f!p} -> blah {}
- Return type:
- direct() <Unknown>[source]
Returns this key in direct form
eg: blah -> blah blah_ -> blah
- Return type:
- indirect() <Unknown>[source]
Returns this key in indirect form
eg: blah -> blah_ blah_ -> blah_
- Return type:
- joined() <Unknown>[source]
Returns the key and params as one string
eg: blah, fmt=5, conv=p -> blah:5!p
- Return type: