Mark simplejson as completed (#9211)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
This commit is contained in:
Nikita Sobolev
2024-02-18 01:50:46 +03:00
committed by GitHub
parent 522f4bc9bf
commit 3fa6374c9a
7 changed files with 273 additions and 29 deletions

View File

@@ -1,14 +1,13 @@
simplejson.JSONDecodeError.__init__
simplejson.JSONDecoder.__init__
simplejson.JSONDecoder.decode
simplejson.JSONDecoder.raw_decode
simplejson.JSONEncoder.__init__
simplejson.decoder.JSONDecoder.__init__
simplejson.decoder.JSONDecoder.decode
simplejson.decoder.JSONDecoder.raw_decode
simplejson.dump
simplejson.dumps
simplejson.encoder.JSONEncoder.__init__
simplejson.load
simplejson.loads
# Speedups (C vs Python inconsistency):
simplejson.scanner.make_scanner
simplejson.scanner.JSONDecodeError.__init__
simplejson.JSONDecodeError.__init__
# Tests are not included:
simplejson.tests.*
# Internal and compat tools:
simplejson.compat
simplejson.ordered_dict
simplejson.tool
simplejson.OrderedDict

View File

@@ -0,0 +1,16 @@
from __future__ import annotations
from typing_extensions import assert_type
from simplejson import JSONEncoder, dumps
class CustomEncoder(JSONEncoder): # eventhough it does not have `extra_kw` arg.
...
# We are only testing `dumps` here, because they are all the same:
dumps([], extra_kw=True) # type: ignore
# Ok:
assert_type(dumps([], cls=CustomEncoder, extra_kw=True), str)