MCPcopy Create free account
hub / github.com/TheAlgorithms/Python / __repr__

Method __repr__

data_compression/lz77.py:48–56  ·  view source on GitHub ↗

>>> token = Token(1, 2, "c") >>> repr(token) '(1, 2, c)' >>> str(token) '(1, 2, c)'

(self)

Source from the content-addressed store, hash-verified

46 indicator: str
47
48 def __repr__(self) -> str:
49 """
50 >>> token = Token(1, 2, "c")
51 >>> repr(token)
52 '(1, 2, c)'
53 >>> str(token)
54 '(1, 2, c)'
55 """
56 return f"({self.offset}, {self.length}, {self.indicator})"
57
58
59class LZ77Compressor:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected