Repository: redis/redis-py
File: redis/commands/core.py (Python)

Code before:
            "STRALGO",
            *pieces,
            len=len,
            idx=idx,
            minmatchlen=minmatchlen,
            withmatchlen=withmatchlen,
            **kwargs,
        )

    def strlen(self, name: KeyT) -> ResponseT:
        """
        Return the number of bytes stored in the value of ``name``

        For more information see https://redis.io/commands/strlen
        """
        return self.execute_command("STRLEN", name)

    def substr(self, name: KeyT, start: int, end: int = -1) -> ResponseT:
        """
        Return a substring of the string at key ``name``. ``start`` and ``end``
        are 0-based integers specifying the portion of the string to return.
        """
        return self.execute_command("SUBSTR", name, start, end)

    def tfunction_load(
        self, lib_code: str, replace: bool = False, config: str = None
    ) -> ResponseT:
        """
        Load a new library to RedisGears.

        ``lib_code`` - the library code.
        ``config`` - a string representation of a JSON object
        that will be provided to the library on load time,
        for more information refer to
        https://github.com/RedisGears/RedisGears/blob/master/docs/function_advance_topics.md#library-configuration
        ``replace`` - an optional argument, instructs RedisGears to replace the
        function if its already exists

        For more information see https://redis.io/commands/tfunction-load/
        # TODO: check link when it will be available
        """
        pieces: list[EncodableT] = []
        if replace:
            pieces.append("REPLACE")
        if config is not None:
            pieces.extend(["CONFIG", config])
        pieces.append(lib_code)
        return self.execute_command("TFUNCTION LOAD", *pieces)

    def tfunction_delete(self, lib_name: str) -> ResponseT:
        """

Review comment (suggestion):
The right type for config is:
```config: Union[str,None] = None```

Code after:
        except TypeError:
            pass
        if withmatchlen:
            pieces.append(b"WITHMATCHLEN")

        return self.execute_command(
            "STRALGO",
            *pieces,
            len=len,
            idx=idx,
            minmatchlen=minmatchlen,
            withmatchlen=withmatchlen,
            **kwargs,
        )

    def strlen(self, name: KeyT) -> ResponseT:
        """
        Return the number of bytes stored in the value of ``name``

        For more information see https://redis.io/commands/strlen
        """
        return self.execute_command("STRLEN", name)

    def substr(self, name: KeyT, start: int, end: int = -1) -> ResponseT:
        """
        Return a substring of the string at key ``name``. ``start`` and ``end``
        are 0-based integers specifying the portion of the string to return.
        """
        return self.execute_command("SUBSTR", name, start, end)

    def touch(self, *args: KeyT) -> ResponseT:
        """
        Alters the last access time of a key(s) ``*args``. A key is ignored
        if it does not exist.

        For more information see https://redis.io/commands/touch
        """
        return self.execute_command("TOUCH", *args)

    def ttl(self, name: KeyT) -> ResponseT:
        """
        Returns the number of seconds until the key ``name`` will expire

        For more information see https://redis.io/commands/ttl
        """
        return self.execute_command("TTL", name)

    def type(self, name: KeyT) -> ResponseT:
        """
        Returns the type of key ``name``