Skip to content

Commit 06707b9

Browse files
belm0jbower-fb
authored andcommitted
pythongh-104018: remove unused format "z" handling in string formatfloat() (python#104107)
This is a cleanup overlooked in PR python#104033.
1 parent 44b081d commit 06707b9

File tree

4 files changed

+0
-8
lines changed

4 files changed

+0
-8
lines changed

Include/internal/pycore_format.h

-2
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,12 @@ extern "C" {
1414
* F_BLANK ' '
1515
* F_ALT '#'
1616
* F_ZERO '0'
17-
* F_NO_NEG_0 'z'
1817
*/
1918
#define F_LJUST (1<<0)
2019
#define F_SIGN (1<<1)
2120
#define F_BLANK (1<<2)
2221
#define F_ALT (1<<3)
2322
#define F_ZERO (1<<4)
24-
#define F_NO_NEG_0 (1<<5)
2523

2624
#ifdef __cplusplus
2725
}

Objects/bytesobject.c

-3
Original file line numberDiff line numberDiff line change
@@ -423,9 +423,6 @@ formatfloat(PyObject *v, int flags, int prec, int type,
423423
if (flags & F_ALT) {
424424
dtoa_flags |= Py_DTSF_ALT;
425425
}
426-
if (flags & F_NO_NEG_0) {
427-
dtoa_flags |= Py_DTSF_NO_NEG_0;
428-
}
429426
p = PyOS_double_to_string(x, type, prec, dtoa_flags, NULL);
430427

431428
if (p == NULL)

Objects/unicodeobject.c

-2
Original file line numberDiff line numberDiff line change
@@ -13452,8 +13452,6 @@ formatfloat(PyObject *v, struct unicode_format_arg_t *arg,
1345213452

1345313453
if (arg->flags & F_ALT)
1345413454
dtoa_flags |= Py_DTSF_ALT;
13455-
if (arg->flags & F_NO_NEG_0)
13456-
dtoa_flags |= Py_DTSF_NO_NEG_0;
1345713455
p = PyOS_double_to_string(x, arg->ch, prec, dtoa_flags, NULL);
1345813456
if (p == NULL)
1345913457
return -1;

Python/ast_opt.c

-1
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,6 @@ simple_format_arg_parse(PyObject *fmt, Py_ssize_t *ppos,
317317
case ' ': *flags |= F_BLANK; continue;
318318
case '#': *flags |= F_ALT; continue;
319319
case '0': *flags |= F_ZERO; continue;
320-
case 'z': *flags |= F_NO_NEG_0; continue;
321320
}
322321
break;
323322
}

0 commit comments

Comments
 (0)