Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
orjson
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OpenVMS
Python
Modules
orjson
Commits
b3355f838c46
Commit
b3355f838c46
authored
4 years ago
by
hauntsaninja <>
Browse files
Options
Downloads
Patches
Plain Diff
orjson.dumps: fix inspect.signature
parent
eef7b29cc0a3
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/lib.rs
+1
-1
1 addition, 1 deletion
src/lib.rs
test/test_api.py
+4
-1
4 additions, 1 deletion
test/test_api.py
with
5 additions
and
2 deletions
src/lib.rs
+
1
−
1
View file @
b3355f83
...
@@ -20,7 +20,7 @@
...
@@ -20,7 +20,7 @@
use
std
::
os
::
raw
::
c_char
;
use
std
::
os
::
raw
::
c_char
;
use
std
::
ptr
::
NonNull
;
use
std
::
ptr
::
NonNull
;
const
DUMPS_DOC
:
&
str
=
"dumps(obj, /, default, option)
\n
--
\n\n
Serialize Python objects to JSON.
\0
"
;
const
DUMPS_DOC
:
&
str
=
"dumps(obj, /, default
=None
, option
=None
)
\n
--
\n\n
Serialize Python objects to JSON.
\0
"
;
const
LOADS_DOC
:
&
str
=
"loads(obj, /)
\n
--
\n\n
Deserialize JSON to Python objects.
\0
"
;
const
LOADS_DOC
:
&
str
=
"loads(obj, /)
\n
--
\n\n
Deserialize JSON to Python objects.
\0
"
;
macro_rules!
opt
{
macro_rules!
opt
{
...
...
This diff is collapsed.
Click to expand it.
test/test_api.py
+
4
−
1
View file @
b3355f83
...
@@ -166,5 +166,5 @@
...
@@ -166,5 +166,5 @@
dumps() valid __text_signature__
dumps() valid __text_signature__
"""
"""
self
.
assertEqual
(
self
.
assertEqual
(
str
(
inspect
.
signature
(
orjson
.
dumps
)),
"
(obj, /, default, option)
"
str
(
inspect
.
signature
(
orjson
.
dumps
)),
"
(obj, /, default
=None
, option
=None
)
"
)
)
...
@@ -170,7 +170,9 @@
...
@@ -170,7 +170,9 @@
)
)
inspect
.
signature
(
orjson
.
dumps
).
bind
(
"
str
"
)
inspect
.
signature
(
orjson
.
dumps
).
bind
(
"
str
"
,
default
=
default
,
option
=
1
)
def
test_loads_signature
(
self
):
def
test_loads_signature
(
self
):
"""
"""
loads() valid __text_signature__
loads() valid __text_signature__
"""
"""
self
.
assertEqual
(
str
(
inspect
.
signature
(
orjson
.
loads
)),
"
(obj, /)
"
)
self
.
assertEqual
(
str
(
inspect
.
signature
(
orjson
.
loads
)),
"
(obj, /)
"
)
...
@@ -171,9 +173,10 @@
...
@@ -171,9 +173,10 @@
def
test_loads_signature
(
self
):
def
test_loads_signature
(
self
):
"""
"""
loads() valid __text_signature__
loads() valid __text_signature__
"""
"""
self
.
assertEqual
(
str
(
inspect
.
signature
(
orjson
.
loads
)),
"
(obj, /)
"
)
self
.
assertEqual
(
str
(
inspect
.
signature
(
orjson
.
loads
)),
"
(obj, /)
"
)
inspect
.
signature
(
orjson
.
loads
).
bind
(
"
[]
"
)
def
test_bytes_buffer
(
self
):
def
test_bytes_buffer
(
self
):
"""
"""
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment