BaseSpecifier class
final
BaseSpecifier
python source
class BaseSpecifier(metaclass=abc.ABCMeta):
@abc.abstractmethod
def __str__(self) -> str:
"""
Returns the str representation of this Specifier-like object. This
should be representative of the Specifier itself.
"""
@abc.abstractmethod
def __hash__(self) -> int:
"""
Returns a hash value for this Specifier-like object.
"""
@abc.abstractmethod
def __eq__(self, other: object) -> bool:
"""
Returns a boolean representing whether or not the two Specifier-like
objects are equal.
:param other: The other object to check against.
"""
@property
@abc.abstractmethod
def prereleases(self) -> Optional[bool]:
"""Whether or not pre-releases as a whole are allowed.
This can be set to either ``True`` or ``False`` to explicitly enable or disable
prereleases or it can be set to ``None`` (the default) to use default semantics.
"""
@prereleases.setter
def prereleases(self, value: bool) -> None:
"""Setter for :attr:`prereleases`.
:param value: The value to set.
"""
@abc.abstractmethod
def contains(self, item: str, prereleases: Optional[bool] = None) -> bool:
"""
Determines if the given item is contained within this specifier.
"""
@abc.abstractmethod
def filter(
self, iterable: Iterable[UnparsedVersionVar], prereleases: Optional[bool] = None
) -> Iterator[UnparsedVersionVar]:
"""
Takes an iterable of items and filters them so that only items which
are contained within this specifier are allowed in it.
"""
- Inheritance
-
- Object
- PythonObjectInterface<PythonFfiDelegate<Object?>, Object?>
- PythonObject
- PythonClass
- BaseSpecifier
Properties
-
finalizer
→ Finalizer<(PythonFfiDelegate<Object?>, Object?)>
-
The finalizer for the python object.
Gets invoked when the object is no longer accessible to the program.
finalinherited
-
hashCode
→ int
-
The hash code for this object.
no setterinherited
-
initializer
→ Initializer<PythonFfiDelegate<Object?>, Object?>
-
The initializer for the python object.
Gets invoked at the start of the constructor.
finalinherited
-
platform
→ PythonFfiDelegate<Object?>
-
Gets the platform that this object is associated with.
no setterinherited
-
prereleases
↔ Object?
-
prereleases (getter)
getter/setter pair
-
reference
→ Object?
-
Gets the reference to the python object.
no setterinherited
-
runtimeType
→ Type
-
A representation of the runtime type of the object.
no setterinherited