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.

Author rhettinger
Recipients Kshitiz17, brandtbucher, rhettinger, steven.daprano, xtreak
Date 2021-06-02.00:06:36
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1622592396.87.0.734666943999.issue44276@roundup.psfhosted.org>
In-reply-to
Content
If the json.encoder code does get updated, it doesn't need two levels of matching.  It can be flattened by eliminating the *chunks* variable.

    match value:
        case str():
            yield _encoder(value)
        case None:
            yield 'null'
        case True:
            yield 'true'
        case False:
            yield 'false'
        case int():
            yield _intstr(value)
        case float():
            yield _floatstr(value)
        case list() | tuple():
            yield from _iterencode_list(value, _current_indent_level)
        case dict():
            yield from _iterencode_dict(value, _current_indent_level)
        case _:
            yield from _iterencode(value, _current_indent_level)
History
Date User Action Args
2021-06-02 00:06:36rhettingersetrecipients: + rhettinger, steven.daprano, xtreak, brandtbucher, Kshitiz17
2021-06-02 00:06:36rhettingersetmessageid: <1622592396.87.0.734666943999.issue44276@roundup.psfhosted.org>
2021-06-02 00:06:36rhettingerlinkissue44276 messages
2021-06-02 00:06:36rhettingercreate