| |
- abc.ABC(builtins.object)
-
- TargetEvaluatorInterface
-
- DynamicTargetEvaluator
- TargetInterface(abc.ABC, typing.Generic)
- typing.Generic(builtins.object)
-
- TargetInterface(abc.ABC, typing.Generic)
class DynamicTargetEvaluator(TargetEvaluatorInterface) |
|
DynamicTargetEvaluator(original: 'str', pattern: 're.Pattern[str]', keys: '_List[str]', markers: '_List[_Tuple[int, int]]') -> 'None'
A regular expression configured to match as many groups as in the provided
keys. When the pattern matches some data, the names of the keys can become
associated with the data that was matched inside each group. |
|
- Method resolution order:
- DynamicTargetEvaluator
- TargetEvaluatorInterface
- abc.ABC
- builtins.object
Methods defined here:
- __init__(self, original: 'str', pattern: 're.Pattern[str]', keys: '_List[str]', markers: '_List[_Tuple[int, int]]') -> 'None'
- Initialize this evaluator.
- compile_key(self, key: 'str', values: 'Substitutions') -> 'str'
- Process the key based on substitution data.
Data and other attributes defined here:
- __abstractmethods__ = frozenset()
Methods inherited from TargetEvaluatorInterface:
- compile(self, values: 'Substitutions') -> 'str'
- Build a string from this target with values replaced for keys that
appeared in the original string.
Data descriptors inherited from TargetEvaluatorInterface:
- __dict__
- dictionary for instance variables
- __weakref__
- list of weak references to the object
|
class TargetEvaluatorInterface(abc.ABC) |
|
TargetEvaluatorInterface(original: 'str', keys: '_List[str]', markers: '_List[_Tuple[int, int]]') -> 'None'
An interface for evaluating targets. |
|
- Method resolution order:
- TargetEvaluatorInterface
- abc.ABC
- builtins.object
Methods defined here:
- __init__(self, original: 'str', keys: '_List[str]', markers: '_List[_Tuple[int, int]]') -> 'None'
- Initialize this evaluator.
- compile(self, values: 'Substitutions') -> 'str'
- Build a string from this target with values replaced for keys that
appeared in the original string.
- compile_key(self, key: 'str', values: 'Substitutions') -> 'str'
- Process the key based on substitution data.
Data descriptors defined here:
- __dict__
- dictionary for instance variables
- __weakref__
- list of weak references to the object
Data and other attributes defined here:
- __abstractmethods__ = frozenset({'compile_key'})
|
class TargetInterface(abc.ABC, typing.Generic) |
|
TargetInterface(data: 'str') -> 'None'
A generic interface for target implementations. |
|
- Method resolution order:
- TargetInterface
- abc.ABC
- typing.Generic
- builtins.object
Methods defined here:
- __eq__(self, other: 'object') -> 'bool'
- Check if two targets are equal.
- __hash__(self) -> 'int'
- Get the hash for this target.
- __init__(self, data: 'str') -> 'None'
- Initialize this target.
- __str__(self) -> 'str'
- Get this target as a string.
- compile(self, substitutions: 'Substitutions' = None) -> 'str'
- Attempt to get a target literal from this target and optional
substitutions.
Class methods defined here:
- is_literal(data: 'str') -> 'bool' from abc.ABCMeta
- Determine if a target is guaranteed to be literal or not.
- parse(data: 'str') -> '_Optional[T]' from abc.ABCMeta
- Obtain an expression target-evaluator from provided string data. If
data doesn't contain any target-evaluation syntax, return None.
- segment_count(data: 'str') -> 'int' from abc.ABCMeta
- Count the number of dynamic segments and validate syntax.
Data descriptors defined here:
- __dict__
- dictionary for instance variables
- __weakref__
- list of weak references to the object
Data and other attributes defined here:
- __abstractmethods__ = frozenset({'parse'})
- __orig_bases__ = (<class 'abc.ABC'>, typing.Generic[~T])
- __parameters__ = (~T,)
- dynamic_end = '}'
- dynamic_start = '{'
Class methods inherited from typing.Generic:
- __class_getitem__(...) from abc.ABCMeta
- Parameterizes a generic class.
At least, parameterizing a generic class is the *main* thing this
method does. For example, for some generic class `Foo`, this is called
when we do `Foo[int]` - there, with `cls=Foo` and `params=int`.
However, note that this method is also called when defining generic
classes in the first place with `class Foo[T]: ...`.
- __init_subclass__(...) from abc.ABCMeta
- Function to initialize subclasses.
| |