Skip to content

Commit eea8edc

Browse files
belm0miss-islington
authored andcommittedMay 7, 2023
pythongh-104018: remove unused format "z" handling in string formatfloat() (pythonGH-104107)
This is a cleanup overlooked in PR pythonGH-104033. (cherry picked from commit 69621d1) Co-authored-by: John Belmonte <[email protected]>
1 parent efcd4bc commit eea8edc

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
@@ -430,9 +430,6 @@ formatfloat(PyObject *v, int flags, int prec, int type,
430430
if (flags & F_ALT) {
431431
dtoa_flags |= Py_DTSF_ALT;
432432
}
433-
if (flags & F_NO_NEG_0) {
434-
dtoa_flags |= Py_DTSF_NO_NEG_0;
435-
}
436433
p = PyOS_double_to_string(x, type, prec, dtoa_flags, NULL);
437434

438435
if (p == NULL)

‎Objects/unicodeobject.c

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

1438614386
if (arg->flags & F_ALT)
1438714387
dtoa_flags |= Py_DTSF_ALT;
14388-
if (arg->flags & F_NO_NEG_0)
14389-
dtoa_flags |= Py_DTSF_NO_NEG_0;
1439014388
p = PyOS_double_to_string(x, arg->ch, prec, dtoa_flags, NULL);
1439114389
if (p == NULL)
1439214390
return -1;

‎Python/ast_opt.c

-1
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,6 @@ simple_format_arg_parse(PyObject *fmt, Py_ssize_t *ppos,
310310
case ' ': *flags |= F_BLANK; continue;
311311
case '#': *flags |= F_ALT; continue;
312312
case '0': *flags |= F_ZERO; continue;
313-
case 'z': *flags |= F_NO_NEG_0; continue;
314313
}
315314
break;
316315
}

0 commit comments

Comments
 (0)
Please sign in to comment.