Skip to content

API 参考

A module that provides a class to mimic slice behavior.

MakeSlice

A class that returns the item itself when called, mimicking a slice object.

Source code in make_slice/__init__.py
4
5
6
7
8
9
class MakeSlice:
    """A class that returns the item itself when called, mimicking a slice object."""

    def __getitem__(self, item: slice) -> slice:
        """Mimics the behavior of a slice object by returning the item itself."""
        return item

__getitem__(item)

Mimics the behavior of a slice object by returning the item itself.

Source code in make_slice/__init__.py
7
8
9
def __getitem__(self, item: slice) -> slice:
    """Mimics the behavior of a slice object by returning the item itself."""
    return item

options: show_source: true