8000 MAINT: Remove any mention of `formatter["str"]` · numpy/numpy@82e5747 · GitHub
[go: up one dir, main page]

Skip to content

Commit 82e5747

Browse files
author
Bas van Beek
committed
MAINT: Remove any mention of formatter["str"]
It's been non-functional for the past 8 years (xref #459)
1 parent 2717731 commit 82e5747

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

numpy/core/arrayprint.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -146,15 +146,14 @@ def set_printoptions(precision=None, threshold=None, edgeitems=None,
146146
- 'longcomplexfloat' : composed of two 128-bit floats
147147
- 'numpystr' : types `numpy.string_` and `numpy.unicode_`
148148
- 'object' : `np.object_` arrays
149-
- 'str' : all other strings
150149
151150
Other keys that can be used to set a group of types at once are:
152151
153152
- 'all' : sets all types
154153
- 'int_kind' : sets 'int'
155154
- 'float_kind' : sets 'float' and 'longfloat'
156155
- 'complex_kind' : sets 'complexfloat' and 'longcomplexfloat'
157-
- 'str_kind' : sets 'str' and 'numpystr'
156+
- 'str_kind' : sets 'numpystr'
158157
floatmode : str, optional
159158
Controls the interpretation of the `precision` option for
160159
floating-point types. Can take the following values
@@ -375,8 +374,7 @@ def _get_formatdict(data, *, precision, floatmode, suppress, sign, legacy,
375374
'timedelta': lambda: TimedeltaFormat(data),
376375
'object': lambda: _object_format,
377376
'void': lambda: str_format,
378-
'numpystr': lambda: repr_format,
379-
'str': lambda: str}
377+
'numpystr': lambda: repr_format}
380378

381379
# we need to wrap values in `formatter` in a lambda, so that the interface
382380
# is the same as the above values.
@@ -398,8 +396,7 @@ def indirect(x):
398396
for key in ['complexfloat', 'longcomplexfloat']:
399397
formatdict[key] = indirect(formatter['complex_kind'])
400398
if 'str_kind' in fkeys:
401-
for key in ['numpystr', 'str']:
402-
formatdict[key] = indirect(formatter['str_kind'])
399+
formatdict['numpystr'] = indirect(formatter['str_kind'])
403400
for key in formatdict.keys():
404401
if key in fkeys:
405402
formatdict[key] = indirect(formatter[key])
@@ -572,15 +569,14 @@ def array2string(a, max_line_width=None, precision=None,
572569
- 'longcomplexfloat' : composed of two 128-bit floats
573570
- 'void' : type `numpy.void`
574571
- 'numpystr' : types `numpy.string_` and `numpy.unicode_`
575-
- 'str' : all other strings
576572
577573
Other keys that can be used to set a group of types at once are:
578574
579575
- 'all' : sets all types
580576
- 'int_kind' : sets 'int'
581577
- 'float_kind' : sets 'float' and 'longfloat'
582578
- 'complex_kind' : sets 'complexfloat' and 'longcomplexfloat'
583-
- 'str_kind' : sets 'str' and 'numpystr'
579+
- 'str_kind' : sets 'numpystr'
584580
threshold : int, optional
585581
Total number of array elements which trigger summarization
586582
rather than full repr.

numpy/core/arrayprint.pyi

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ class _FormatDict(TypedDict, total=False):
4040
void: Callable[[void], str]
4141
numpystr: Callable[[_CharLike], str]
4242
object: Callable[[object], str]
43-
str: Callable[[Any], str] # Unused but still present?
4443
all: Callable[[object], str]
4544
int_kind: Callable[[integer[Any]], str]
4645
float_kind: Callable[[floating[Any]], str]

0 commit comments

Comments
 (0)
0