Add support for ipaddress objects in JSONEncoder#9087
Add support for ipaddress objects in JSONEncoder#9087auvipy merged 7 commits intoencode:mainfrom corenting:jsonencoder_ipaddress
ipaddress objects in JSONEncoder#9087Conversation
|
@auvipy sorry for the ping, is it possible to take a look? |
|
Yes of course |
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
There was a problem hiding this comment.
I believe this should be very safe to add and has afais no potential for a regression.
ipaddress was added in python 3.3, and thus should be safe to import too.
I think this is a good change because it closes a functional gap, that one would consider to not even be there, until it bites you.
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
auvipy
left a comment
There was a problem hiding this comment.
should we also document this?
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Sorry I hadn't seen the comment (and for the closed/reopened issue, I missclicked). Should I add it somewhere in the doc, or maybe in a separate PR to first merge this one ? |
Good question. The only relevant piece of documentation I could find is this page. Currently, it stays relatively high level and doesn't try to document how each data type is rendered, which I think is fine. So unless you know of an existing place where the doc is more detailed on JSON encoding, I would suggest to not bother with adding it. |
Thanks for checking! I will leave the MR as-is then. |
browniebroke
left a comment
There was a problem hiding this comment.
Apologies for not picking this up earlier, would you mind maing these changes? Looks good otherwise
Co-authored-by: Bruno Alla <browniebroke@users.noreply.github.com>
ipaddress objects in JSONEncoder
Description
The aim of this PR is to have support for ipaddress objects in JSONEncoder, similar to what was done for UUIDs for example.