from typing import Optional


def parse_slice(value : str) -> Optional[slice]:
    """
    Parses a `slice()` from string, like `start:stop:step`.

    Args:
        value:
            A string value that contains the slice string. For example: `start:stop:step`.
    
    Returns:
        A slice object or `None` if string is not valid. 
    """
    try:
        if value:
            return slice(*[int(p) if p else None for p in value.split(":")])
    except (TypeError, ValueError):
        return None