Fixed trouble with dataclass syntax in pypy3.5.
@@ -4,7 +4,7 @@ from collections import deque, namedtuple
import sys
if sys.version_info >= (3, 7):
- from dataclasses import make_dataclass
+ from dataclasses import dataclass, make_dataclass
from decimal import Decimal
from unittest import TestCase
@@ -198,4 +198,15 @@ MyNamedTuple = namedtuple("MyNamedTuple", field_names=["a", "b", "c"])
if sys.version_info >= (3, 7):
+ # This prevents the module loading in pypy3.5:
+ #
+ # @dataclass
+ # class MyDataClass:
+ # a: int
+ # b: str
+ # c: Decimal
+ #
+ # So need to do this instead:
+ #
MyDataClass = make_dataclass('MyDataClass', ['a', 'b', 'c'])
+ MyDataClass.__module__ = __name__
