Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion jsonweb/decode.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ def decode_obj(self, obj):


def get_arg_spec(func):
arg_spec = inspect.getargspec(func)
arg_spec = inspect.getfullargspec(func)
args = arg_spec.args

try:
Expand Down
14 changes: 13 additions & 1 deletion jsonweb/tests/test_decode.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,4 +355,16 @@ def __init__(self, title):

self.assertEqual(decode._as_type_context.top, Person)

self.assertEqual(decode._as_type_context.top, None)
self.assertEqual(decode._as_type_context.top, None)

def test_decode_with_py3_type_annotation(self):
@decode.from_object()
class Person:
def __init__(self, name: str):
self.name = name

json_str = '{"__type__": "Person", "name": "shawn"}'
person = loader(json_str)

self.assertTrue(isinstance(person, Person))
self.assertEqual(person.name, "shawn")
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os
from setuptools import setup, find_packages

version = '0.8.2'
version = '0.8.3'

if os.path.exists("README.rst"):
long_description = open("README.rst").read()
Expand Down