Skip to content

Commit 9819acf

Browse files
committed
REF: Clean up print_thing implementation
- Remove Real numbers reference from docstring - Remove Turkish comments - Fix import structure in tests
1 parent 6b20acc commit 9819acf

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

pandas/io/formats/printing.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ def pprint_thing(
177177
max_seq_items: int | None = None,
178178
) -> str:
179179
"""
180-
Convert object to a string representation, respecting display.precision for Real numbers.
180+
Convert object to a string representation.
181181
182182
Parameters
183183
----------
@@ -199,8 +199,6 @@ def pprint_thing(
199199
str
200200
String representation of the object.
201201
"""
202-
203-
204202
def as_escaped_string(
205203
thing: Any, escape_chars: EscapeChars | None = escape_chars
206204
) -> str:
@@ -214,7 +212,6 @@ def as_escaped_string(
214212
else:
215213
escape_chars = escape_chars or ()
216214

217-
# is_float kullanımına geçiş yapıyoruz
218215
if is_float(thing):
219216
result = f"{thing:.{get_option('display.precision')}f}"
220217
else:

pandas/tests/io/formats/test_printing.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,11 @@ def test_repr_mapping(self):
8282
assert printing.pprint_thing(MyMapping()) == "{'a': 4, 'b': 4}"
8383

8484
def test_pprint_thing_real_precision(self):
85+
from pandas.io.formats.printing import pprint_thing
8586
with option_context('display.precision', 3):
86-
assert printing.pprint_thing(3.14159265359) == "3.142"
87+
assert pprint_thing(3.14159265359) == "3.142"
8788
with option_context('display.precision', 2):
88-
assert printing.pprint_thing(3.14159265359) == "3.14"
89+
assert pprint_thing(3.14159265359) == "3.14"
8990

9091

9192
class TestFormatBase:

0 commit comments

Comments
 (0)