Type definitions
Type definitions used in lintkit
.
Note
This module is mostly used internally, unlikely to be directly useful for linter creators.
lintkit.type_definitions.Output module-attribute
¶
Output = Callable[[str, int, str, Path | None, int | None, int | None, int | None, int | None], None]
Type of function which is used to output errors.
Info
See lintkit.output
and lintkit.settings.output
for more information.
Tip
Custom output
functions should follow this signature.
lintkit.type_definitions.GetItem ¶
Bases: Protocol
Protocol used to type objects with __getitem__
and __contains__
.
lintkit.type_definitions.GetItem.__getitem__ ¶
Signature of __getitem__
method.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
key | Hashable | Key to get the value for (must implement | required |
Returns:
Type | Description |
---|---|
Any | Value for the key. |
lintkit.type_definitions.GetItem.__contains__ ¶
Signature of __contains__
method.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
key | Hashable | Key to check for (must implement | required |
Returns:
Type | Description |
---|---|
bool | True if the key is in the object, False otherwise. |