Skip to content

Commit 6468aba

Browse files
committed
fix: remove indentation when inline-printing ptrs
1 parent 108848f commit 6468aba

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

libdestruct/common/obj.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ def value(self: obj, value: object) -> None:
108108

109109
self._set(value)
110110

111-
def to_str(self: obj, indent: int = 0) -> str:
111+
def to_str(self: obj, _: int = 0) -> str:
112112
"""Return a string representation of the object."""
113113
return f"{self.get()}"
114114

libdestruct/common/ptr/ptr.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,18 +82,18 @@ def try_unwrap(self: ptr, length: int | None = None) -> obj | None:
8282

8383
return self.unwrap(length)
8484

85-
def to_str(self: ptr, indent: int = 0) -> str:
85+
def to_str(self: ptr, _: int = 0) -> str:
8686
"""Return a string representation of the pointer."""
8787
if not self.wrapper:
88-
return f"{' ' * indent}ptr@0x{self.get():x}"
88+
return f"ptr@0x{self.get():x}"
8989

9090
# Pretty print inflaters:
9191
if callable(self.wrapper) and hasattr(self.wrapper, "__self__") and isinstance(self.wrapper.__self__, Field):
9292
name = self.wrapper.__self__.__class__.__qualname__
9393
else:
9494
name = self.wrapper.__name__
9595

96-
return f"{' ' * indent}{name}@0x{self.get():x}"
96+
return f"{name}@0x{self.get():x}"
9797

9898
def __str__(self: ptr) -> str:
9999
"""Return a string representation of the pointer."""

0 commit comments

Comments
 (0)