[issue31466] No easy way to change float formatting when subclassing encoder.JSONEncoder

2021-04-01 Thread Samuel Freilich


Samuel Freilich  added the comment:

I think the less-minor issue, of which this is a small subset, is that 
JSONEncoder doesn't allow changing the behavior for default-serializable types 
at all. That means you can't choose to lose less information in round-trip 
serialization/deserialization, if that's what you want (e.g. there's no way to 
round-trip serialize a tuple with JSONEncoder, though it's trivial to do that 
for a set).

--
nosy: +sfreilich

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31466] No easy way to change float formatting when subclassing encoder.JSONEncoder

2021-03-07 Thread Inada Naoki


Change by Inada Naoki :


--
resolution:  -> rejected
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31466] No easy way to change float formatting when subclassing encoder.JSONEncoder

2019-03-26 Thread Cheryl Sabella


Change by Cheryl Sabella :


--
versions: +Python 3.7, Python 3.8 -Python 3.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31466] No easy way to change float formatting when subclassing encoder.JSONEncoder

2017-09-15 Thread Éric Araujo

Éric Araujo added the comment:

Hello and thanks for the patch!  If you don’t get feedback, you could try the 
python-ideas mailing list to see if other people have the same need and if 
there’s already a solution for this.

Serhiy, would you mind refreshing my memory about json development?  I’m not 
sure whether it’s still supposed to follow the development of simplejson, or if 
it’s effectively a fork now.

--
nosy: +serhiy.storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31466] No easy way to change float formatting when subclassing encoder.JSONEncoder

2017-09-15 Thread Éric Araujo

Changes by Éric Araujo :


--
nosy: +merwok

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31466] No easy way to change float formatting when subclassing encoder.JSONEncoder

2017-09-14 Thread Quentin Peter

Changes by Quentin Peter :


--
keywords: +patch
pull_requests: +3561
stage:  -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31466] No easy way to change float formatting when subclassing encoder.JSONEncoder

2017-09-14 Thread Quentin Peter

New submission from Quentin Peter:

I want to output floats in ENG format. Working with distance in micrometers, it 
is a bit annoying to see:
2.5e-5
.0003
instead of 
25e-6
300e-6
The solution I found was to redefine `iterencode` but that doesn't feel right.

I would like to see something similar to the "default" function that is easely 
modified.

--
messages: 302162
nosy: qpeter
priority: normal
severity: normal
status: open
title: No easy way to change float formatting when subclassing 
encoder.JSONEncoder
type: enhancement
versions: Python 3.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com