-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
41 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Complete annotations and add ``py.typed`` marker -- by :user:`Avasam` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -67,7 +67,3 @@ type = [ | |
|
||
|
||
[tool.setuptools_scm] | ||
|
||
|
||
[tool.pytest-enabler.mypy] | ||
# Disabled due to jaraco/skeleton#143 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,40 @@ | ||
import importlib | ||
from __future__ import annotations | ||
|
||
import collections | ||
import decimal | ||
import importlib | ||
|
||
import jsonpickle | ||
|
||
|
||
def setup_module(): | ||
def setup_module() -> None: | ||
importlib.import_module('jaraco.modb') | ||
|
||
|
||
def roundtrip(ob): | ||
def roundtrip(ob: object) -> None: | ||
encoded = jsonpickle.encode(ob) | ||
print('encoded is', encoded) | ||
decoded = jsonpickle.decode(encoded) | ||
assert decoded == ob | ||
|
||
|
||
def test_OrderedDict(): | ||
def test_OrderedDict() -> None: | ||
d = collections.OrderedDict(y=3) | ||
roundtrip(d) | ||
|
||
|
||
def test_Decimal(): | ||
def test_Decimal() -> None: | ||
roundtrip(decimal.Decimal(1.0)) | ||
roundtrip(decimal.Decimal(1000)) | ||
|
||
|
||
class MyText(str): | ||
def __reduce__(self): | ||
def __reduce__(self) -> tuple[type[MyText], tuple[str]]: | ||
return MyText, (str(self),) | ||
|
||
|
||
class TestUnicodeSubclass(object): | ||
class TestUnicodeSubclass: | ||
"This technique demonstrates how to handle a text-type subclass" | ||
|
||
def test_UnicodeSubclass(self): | ||
def test_UnicodeSubclass(self) -> None: | ||
roundtrip(MyText('foo')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters