This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Library json, file json/encoder.py: Function floatstr should be a class-level function.
Type: enhancement Stage: patch review
Components: Library (Lib) Versions: Python 3.10, Python 3.9, Python 3.8, Python 3.7, Python 3.6
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: python-dev, salacdav
Priority: normal Keywords: patch

Created on 2020-11-22 11:15 by salacdav, last changed 2022-04-11 14:59 by admin.

Files
File name Uploaded Description Edit
encoder.py salacdav, 2020-11-22 11:15 Code of file cpython/Lib/json/encoder.py with strange behaviour
Pull Requests
URL Status Linked Edit
PR 23459 closed python-dev, 2020-11-22 11:20
Messages (1)
msg381609 - (view) Author: David Salač (salacdav) Date: 2020-11-22 11:15
The logic as it is implemented now does not allow to user to override floatstr function. That makes things enormously inconvenient for people who need any different of behaviour (for example return string values defining Infinity, NaN or -Infinity). If it was moved on the class-level, it would easier because it makes floatstr to be a class-level function.
History
Date User Action Args
2022-04-11 14:59:38adminsetgithub: 86600
2020-11-22 11:20:47python-devsetkeywords: + patch
nosy: + python-dev

pull_requests: + pull_request22351
stage: patch review
2020-11-22 11:15:21salacdavcreate