Skip to content
Closed
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
8 changes: 6 additions & 2 deletions Lib/dataclasses.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
from copy import deepcopy
import collections
import inspect
import typing

__all__ = ['dataclass',
__all__ = ('dataclass',
'Data',
'field',
'FrozenInstanceError',
'InitVar',
Expand All @@ -15,7 +17,9 @@
'astuple',
'make_dataclass',
'replace',
]
)

Data = typing.Any

# Raised when an attempt is made to modify a frozen class.
class FrozenInstanceError(AttributeError): pass
Expand Down
6 changes: 3 additions & 3 deletions Lib/test/test_dataclasses.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
from dataclasses import (
dataclass, field, FrozenInstanceError, fields, asdict, astuple,
dataclass, Data, field, FrozenInstanceError, fields, asdict, astuple,
make_dataclass, replace, InitVar, Field
)

import pickle
import inspect
import unittest
from unittest.mock import Mock
from typing import ClassVar, Any, List, Union, Tuple, Dict, Generic, TypeVar
from typing import ClassVar, List, Union, Tuple, Dict, Generic, TypeVar
from collections import deque, OrderedDict, namedtuple

# Just any custom exception we can catch.
Expand Down Expand Up @@ -200,7 +200,7 @@ def test_overwrite_fields_in_derived_class(self):
# the same as defined in Base.
@dataclass
class Base:
x: Any = 15.0
x: Data = 15.0
y: int = 0

@dataclass
Expand Down