dycw-utilities 0.112.3__py3-none-any.whl → 0.112.5__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {dycw_utilities-0.112.3.dist-info → dycw_utilities-0.112.5.dist-info}/METADATA +12 -12
- {dycw_utilities-0.112.3.dist-info → dycw_utilities-0.112.5.dist-info}/RECORD +8 -8
- utilities/__init__.py +1 -1
- utilities/dataclasses.py +25 -5
- utilities/parse.py +15 -13
- utilities/typing.py +8 -6
- {dycw_utilities-0.112.3.dist-info → dycw_utilities-0.112.5.dist-info}/WHEEL +0 -0
- {dycw_utilities-0.112.3.dist-info → dycw_utilities-0.112.5.dist-info}/licenses/LICENSE +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: dycw-utilities
|
3
|
-
Version: 0.112.
|
3
|
+
Version: 0.112.5
|
4
4
|
Author-email: Derek Wan <d.wan@icloud.com>
|
5
5
|
License-File: LICENSE
|
6
6
|
Requires-Python: >=3.12
|
@@ -24,7 +24,7 @@ Provides-Extra: zzz-test-altair
|
|
24
24
|
Requires-Dist: altair<5.6,>=5.5.0; extra == 'zzz-test-altair'
|
25
25
|
Requires-Dist: atomicwrites<1.5,>=1.4.1; extra == 'zzz-test-altair'
|
26
26
|
Requires-Dist: img2pdf<0.7,>=0.6.0; extra == 'zzz-test-altair'
|
27
|
-
Requires-Dist: polars-lts-cpu<1.
|
27
|
+
Requires-Dist: polars-lts-cpu<1.29,>=1.28.1; extra == 'zzz-test-altair'
|
28
28
|
Requires-Dist: vl-convert-python<1.8,>=1.7.0; extra == 'zzz-test-altair'
|
29
29
|
Requires-Dist: whenever<0.8,>=0.7.3; extra == 'zzz-test-altair'
|
30
30
|
Provides-Extra: zzz-test-astor
|
@@ -48,7 +48,7 @@ Provides-Extra: zzz-test-cvxpy
|
|
48
48
|
Requires-Dist: cvxpy<1.7,>=1.6.5; extra == 'zzz-test-cvxpy'
|
49
49
|
Provides-Extra: zzz-test-dataclasses
|
50
50
|
Requires-Dist: orjson<3.11,>=3.10.15; extra == 'zzz-test-dataclasses'
|
51
|
-
Requires-Dist: polars-lts-cpu<1.
|
51
|
+
Requires-Dist: polars-lts-cpu<1.29,>=1.28.1; extra == 'zzz-test-dataclasses'
|
52
52
|
Requires-Dist: whenever<0.8,>=0.7.3; extra == 'zzz-test-dataclasses'
|
53
53
|
Provides-Extra: zzz-test-datetime
|
54
54
|
Requires-Dist: tzlocal<5.4,>=5.3.1; extra == 'zzz-test-datetime'
|
@@ -70,7 +70,7 @@ Provides-Extra: zzz-test-getpass
|
|
70
70
|
Provides-Extra: zzz-test-git
|
71
71
|
Provides-Extra: zzz-test-hashlib
|
72
72
|
Requires-Dist: orjson<3.11,>=3.10.15; extra == 'zzz-test-hashlib'
|
73
|
-
Requires-Dist: polars-lts-cpu<1.
|
73
|
+
Requires-Dist: polars-lts-cpu<1.29,>=1.28.1; extra == 'zzz-test-hashlib'
|
74
74
|
Requires-Dist: whenever<0.8,>=0.7.3; extra == 'zzz-test-hashlib'
|
75
75
|
Provides-Extra: zzz-test-http
|
76
76
|
Requires-Dist: atomicwrites<1.5,>=1.4.1; extra == 'zzz-test-http'
|
@@ -92,12 +92,12 @@ Requires-Dist: whenever<0.8,>=0.7.3; extra == 'zzz-test-hypothesis'
|
|
92
92
|
Provides-Extra: zzz-test-ipython
|
93
93
|
Requires-Dist: ipython<9.1,>=9.0.1; extra == 'zzz-test-ipython'
|
94
94
|
Provides-Extra: zzz-test-iterables
|
95
|
-
Requires-Dist: polars-lts-cpu<1.
|
95
|
+
Requires-Dist: polars-lts-cpu<1.29,>=1.28.1; extra == 'zzz-test-iterables'
|
96
96
|
Requires-Dist: whenever<0.8,>=0.7.3; extra == 'zzz-test-iterables'
|
97
97
|
Provides-Extra: zzz-test-jupyter
|
98
98
|
Requires-Dist: jupyterlab<4.3,>=4.2.0; extra == 'zzz-test-jupyter'
|
99
99
|
Requires-Dist: pandas<2.3,>=2.2.2; extra == 'zzz-test-jupyter'
|
100
|
-
Requires-Dist: polars-lts-cpu<1.
|
100
|
+
Requires-Dist: polars-lts-cpu<1.29,>=1.28.1; extra == 'zzz-test-jupyter'
|
101
101
|
Provides-Extra: zzz-test-logging
|
102
102
|
Requires-Dist: atomicwrites<1.5,>=1.4.1; extra == 'zzz-test-logging'
|
103
103
|
Requires-Dist: coloredlogs<15.1,>=15.0.1; extra == 'zzz-test-logging'
|
@@ -121,13 +121,13 @@ Requires-Dist: more-itertools<10.8,>=10.7.0; extra == 'zzz-test-more-itertools'
|
|
121
121
|
Provides-Extra: zzz-test-numpy
|
122
122
|
Requires-Dist: numpy<2.3,>=2.2.5; extra == 'zzz-test-numpy'
|
123
123
|
Provides-Extra: zzz-test-operator
|
124
|
-
Requires-Dist: polars-lts-cpu<1.
|
124
|
+
Requires-Dist: polars-lts-cpu<1.29,>=1.28.1; extra == 'zzz-test-operator'
|
125
125
|
Requires-Dist: whenever<0.8,>=0.7.3; extra == 'zzz-test-operator'
|
126
126
|
Provides-Extra: zzz-test-optuna
|
127
127
|
Requires-Dist: optuna<4.4,>=4.3.0; extra == 'zzz-test-optuna'
|
128
128
|
Provides-Extra: zzz-test-orjson
|
129
129
|
Requires-Dist: orjson<3.11,>=3.10.15; extra == 'zzz-test-orjson'
|
130
|
-
Requires-Dist: polars-lts-cpu<1.
|
130
|
+
Requires-Dist: polars-lts-cpu<1.29,>=1.28.1; extra == 'zzz-test-orjson'
|
131
131
|
Requires-Dist: rich<14.1,>=14.0.0; extra == 'zzz-test-orjson'
|
132
132
|
Requires-Dist: tzlocal<5.4,>=5.3.1; extra == 'zzz-test-orjson'
|
133
133
|
Requires-Dist: whenever<0.8,>=0.7.3; extra == 'zzz-test-orjson'
|
@@ -138,7 +138,7 @@ Requires-Dist: atomicwrites<1.5,>=1.4.1; extra == 'zzz-test-pickle'
|
|
138
138
|
Provides-Extra: zzz-test-platform
|
139
139
|
Provides-Extra: zzz-test-polars
|
140
140
|
Requires-Dist: dacite<1.10,>=1.9.2; extra == 'zzz-test-polars'
|
141
|
-
Requires-Dist: polars-lts-cpu<1.
|
141
|
+
Requires-Dist: polars-lts-cpu<1.29,>=1.28.1; extra == 'zzz-test-polars'
|
142
142
|
Requires-Dist: whenever<0.8,>=0.7.3; extra == 'zzz-test-polars'
|
143
143
|
Provides-Extra: zzz-test-pqdm
|
144
144
|
Requires-Dist: pqdm<0.3,>=0.2.0; extra == 'zzz-test-pqdm'
|
@@ -164,7 +164,7 @@ Provides-Extra: zzz-test-random
|
|
164
164
|
Provides-Extra: zzz-test-re
|
165
165
|
Provides-Extra: zzz-test-redis
|
166
166
|
Requires-Dist: orjson<3.11,>=3.10.15; extra == 'zzz-test-redis'
|
167
|
-
Requires-Dist: polars-lts-cpu<1.
|
167
|
+
Requires-Dist: polars-lts-cpu<1.29,>=1.28.1; extra == 'zzz-test-redis'
|
168
168
|
Requires-Dist: redis<5.3,>=5.2.1; extra == 'zzz-test-redis'
|
169
169
|
Requires-Dist: rich<14.1,>=14.0.0; extra == 'zzz-test-redis'
|
170
170
|
Requires-Dist: tenacity<9.0,>=8.5.0; extra == 'zzz-test-redis'
|
@@ -192,7 +192,7 @@ Requires-Dist: aiosqlite<0.22,>=0.21.0; extra == 'zzz-test-sqlalchemy-polars'
|
|
192
192
|
Requires-Dist: asyncpg<0.31,>=0.30.0; extra == 'zzz-test-sqlalchemy-polars'
|
193
193
|
Requires-Dist: greenlet<3.3,>=3.2.0; extra == 'zzz-test-sqlalchemy-polars'
|
194
194
|
Requires-Dist: nest-asyncio<1.7,>=1.6.0; extra == 'zzz-test-sqlalchemy-polars'
|
195
|
-
Requires-Dist: polars-lts-cpu<1.
|
195
|
+
Requires-Dist: polars-lts-cpu<1.29,>=1.28.1; extra == 'zzz-test-sqlalchemy-polars'
|
196
196
|
Requires-Dist: sqlalchemy<2.1,>=2.0.40; extra == 'zzz-test-sqlalchemy-polars'
|
197
197
|
Requires-Dist: tenacity<9.0,>=8.5.0; extra == 'zzz-test-sqlalchemy-polars'
|
198
198
|
Requires-Dist: whenever<0.8,>=0.7.3; extra == 'zzz-test-sqlalchemy-polars'
|
@@ -217,7 +217,7 @@ Requires-Dist: tzlocal<5.4,>=5.3.1; extra == 'zzz-test-traceback'
|
|
217
217
|
Requires-Dist: whenever<0.8,>=0.7.3; extra == 'zzz-test-traceback'
|
218
218
|
Provides-Extra: zzz-test-types
|
219
219
|
Provides-Extra: zzz-test-typing
|
220
|
-
Requires-Dist: polars-lts-cpu<1.
|
220
|
+
Requires-Dist: polars-lts-cpu<1.29,>=1.28.1; extra == 'zzz-test-typing'
|
221
221
|
Requires-Dist: whenever<0.8,>=0.7.3; extra == 'zzz-test-typing'
|
222
222
|
Provides-Extra: zzz-test-tzlocal
|
223
223
|
Requires-Dist: tzlocal<5.4,>=5.3.1; extra == 'zzz-test-tzlocal'
|
@@ -1,4 +1,4 @@
|
|
1
|
-
utilities/__init__.py,sha256=
|
1
|
+
utilities/__init__.py,sha256=YhMz5tXURLSN-FqrtF7DSHZw1xY-ecf2SJGla-Mbe6k,60
|
2
2
|
utilities/altair.py,sha256=Gpja-flOo-Db0PIPJLJsgzAlXWoKUjPU1qY-DQ829ek,9156
|
3
3
|
utilities/astor.py,sha256=xuDUkjq0-b6fhtwjhbnebzbqQZAjMSHR1IIS5uOodVg,777
|
4
4
|
utilities/asyncio.py,sha256=41oQUurWMvadFK5gFnaG21hMM0Vmfn2WS6OpC0R9mas,14757
|
@@ -11,7 +11,7 @@ utilities/contextlib.py,sha256=OOIIEa5lXKGzFAnauaul40nlQnQko6Na4ryiMJcHkIg,478
|
|
11
11
|
utilities/contextvars.py,sha256=RsSGGrbQqqZ67rOydnM7WWIsM2lIE31UHJLejnHJPWY,505
|
12
12
|
utilities/cryptography.py,sha256=HyOewI20cl3uRXsKivhIaeLVDInQdzgXZGaly7hS5dE,771
|
13
13
|
utilities/cvxpy.py,sha256=Rv1-fD-XYerosCavRF8Pohop2DBkU3AlFaGTfD8AEAA,13776
|
14
|
-
utilities/dataclasses.py,sha256=
|
14
|
+
utilities/dataclasses.py,sha256=EG2lZRPU_rmkP3KWR7J5J43r8hr68s9uchSvevxpoZI,27433
|
15
15
|
utilities/datetime.py,sha256=OF7jZE702UecnwAbq9D3N-GINpp9gSGoidki1RhimCE,35752
|
16
16
|
utilities/enum.py,sha256=HoRwVCWzsnH0vpO9ZEcAAIZLMv0Sn2vJxxA4sYMQgDs,5793
|
17
17
|
utilities/errors.py,sha256=BtSNP0JC3ik536ddPyTerLomCRJV9f6kdMe6POz0QHM,361
|
@@ -41,7 +41,7 @@ utilities/operator.py,sha256=0M2yZJ0PODH47ogFEnkGMBe_cfxwZR02T_92LZVZvHo,3715
|
|
41
41
|
utilities/optuna.py,sha256=loyJGWTzljgdJaoLhP09PT8Jz6o_pwBOwehY33lHkhw,1923
|
42
42
|
utilities/orjson.py,sha256=DBm2zPP04kcHpY3l1etL24ksNynu-R3duFyx3U-RjqQ,36948
|
43
43
|
utilities/os.py,sha256=D_FyyT-6TtqiN9KSS7c9g1fnUtgxmyMtzAjmYLkk46A,3587
|
44
|
-
utilities/parse.py,sha256=
|
44
|
+
utilities/parse.py,sha256=Qr8hw14v0Bfxnc0TjFfjZtmYk6FrdVoqLnszb7R27BA,18982
|
45
45
|
utilities/pathlib.py,sha256=31WPMXdLIyXgYOMMl_HOI2wlo66MGSE-cgeelk-Lias,1410
|
46
46
|
utilities/period.py,sha256=RWfcNVoNlW07RNdU47g_zuLZMKbtgfK4bE6G-9tVjY8,11024
|
47
47
|
utilities/pickle.py,sha256=Bhvd7cZl-zQKQDFjUerqGuSKlHvnW1K2QXeU5UZibtg,657
|
@@ -78,7 +78,7 @@ utilities/threading.py,sha256=GvBOp4CyhHfN90wGXZuA2VKe9fGzMaEa7oCl4f3nnPU,1009
|
|
78
78
|
utilities/timer.py,sha256=Rkc49KSpHuC8s7vUxGO9DU55U9I6yDKnchsQqrUCVBs,4075
|
79
79
|
utilities/traceback.py,sha256=secexUnBsecfWV4ZuqP1W4pGF3prOeO1CRyJK-8zQDU,27402
|
80
80
|
utilities/types.py,sha256=kVY71hZkcnyYNIlYSse0mLm8yeP3OBkzhDPMME6jXxo,18126
|
81
|
-
utilities/typing.py,sha256=
|
81
|
+
utilities/typing.py,sha256=ypaAUKjLIR89NlzcQnOXuKCwCHcp8ur8sDLkNKHAGoA,13737
|
82
82
|
utilities/tzdata.py,sha256=yCf70NICwAeazN3_JcXhWvRqCy06XJNQ42j7r6gw3HY,1217
|
83
83
|
utilities/tzlocal.py,sha256=3upDNFBvGh1l9njmLR2z2S6K6VxQSb7QizYGUbAH3JU,960
|
84
84
|
utilities/uuid.py,sha256=jJTFxz-CWgltqNuzmythB7iEQ-Q1mCwPevUfKthZT3c,611
|
@@ -87,7 +87,7 @@ utilities/warnings.py,sha256=un1LvHv70PU-LLv8RxPVmugTzDJkkGXRMZTE2-fTQHw,1771
|
|
87
87
|
utilities/whenever.py,sha256=iLRP_-8CZtBpHKbGZGu-kjSMg1ZubJ-VSmgSy7Eudxw,17787
|
88
88
|
utilities/zipfile.py,sha256=24lQc9ATcJxHXBPc_tBDiJk48pWyRrlxO2fIsFxU0A8,699
|
89
89
|
utilities/zoneinfo.py,sha256=-Xm57PMMwDTYpxJdkiJG13wnbwK--I7XItBh5WVhD-o,1874
|
90
|
-
dycw_utilities-0.112.
|
91
|
-
dycw_utilities-0.112.
|
92
|
-
dycw_utilities-0.112.
|
93
|
-
dycw_utilities-0.112.
|
90
|
+
dycw_utilities-0.112.5.dist-info/METADATA,sha256=uE2jadDQbFgL7nR5zfTSo9IPPZFgtolnNmcbVnRkdXc,13004
|
91
|
+
dycw_utilities-0.112.5.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
92
|
+
dycw_utilities-0.112.5.dist-info/licenses/LICENSE,sha256=gppZp16M6nSVpBbUBrNL6JuYfvKwZiKgV7XoKKsHzqo,1066
|
93
|
+
dycw_utilities-0.112.5.dist-info/RECORD,,
|
utilities/__init__.py
CHANGED
utilities/dataclasses.py
CHANGED
@@ -22,7 +22,12 @@ from utilities.functions import (
|
|
22
22
|
)
|
23
23
|
from utilities.iterables import OneStrEmptyError, OneStrNonUniqueError, one_str
|
24
24
|
from utilities.operator import is_equal
|
25
|
-
from utilities.parse import
|
25
|
+
from utilities.parse import (
|
26
|
+
_ParseObjectExtraNonUniqueError,
|
27
|
+
_ParseObjectParseError,
|
28
|
+
parse_object,
|
29
|
+
serialize_object,
|
30
|
+
)
|
26
31
|
from utilities.re import ExtractGroupError, extract_group
|
27
32
|
from utilities.sentinel import Sentinel, sentinel
|
28
33
|
from utilities.text import (
|
@@ -570,8 +575,12 @@ def _parse_dataclass_parse_text(
|
|
570
575
|
case_sensitive=case_sensitive,
|
571
576
|
extra=extra,
|
572
577
|
)
|
573
|
-
except
|
574
|
-
raise
|
578
|
+
except _ParseObjectParseError:
|
579
|
+
raise _ParseDataClassTextParseError(cls=cls, field=field, text=text) from None
|
580
|
+
except _ParseObjectExtraNonUniqueError as error:
|
581
|
+
raise _ParseDataClassTextExtraNonUniqueError(
|
582
|
+
cls=cls, field=field, text=text, first=error.first, second=error.second
|
583
|
+
) from None
|
575
584
|
|
576
585
|
|
577
586
|
@dataclass(kw_only=True, slots=True)
|
@@ -597,12 +606,23 @@ class _ParseDataClassSplitKeyValuePairsDuplicateKeysError(ParseDataClassError):
|
|
597
606
|
|
598
607
|
|
599
608
|
@dataclass(kw_only=True, slots=True)
|
600
|
-
class
|
609
|
+
class _ParseDataClassTextParseError(ParseDataClassError[TDataclass]):
|
610
|
+
field: _YieldFieldsClass[Any]
|
611
|
+
|
612
|
+
@override
|
613
|
+
def __str__(self) -> str:
|
614
|
+
return f"Unable to construct {get_class_name(self.cls)!r} since the field {self.field.name!r} of type {self.field.type_!r} could not be parsed; got {self.text!r}"
|
615
|
+
|
616
|
+
|
617
|
+
@dataclass(kw_only=True, slots=True)
|
618
|
+
class _ParseDataClassTextExtraNonUniqueError(ParseDataClassError[TDataclass]):
|
601
619
|
field: _YieldFieldsClass[Any]
|
620
|
+
first: type[Any]
|
621
|
+
second: type[Any]
|
602
622
|
|
603
623
|
@override
|
604
624
|
def __str__(self) -> str:
|
605
|
-
return f"Unable to construct {get_class_name(self.cls)!r}
|
625
|
+
return f"Unable to construct {get_class_name(self.cls)!r} since the field {self.field.name!r} of type {self.field.type_!r} must contain exactly one parent class in `extra`; got {self.first!r}, {self.second!r} and perhaps more"
|
606
626
|
|
607
627
|
|
608
628
|
##
|
utilities/parse.py
CHANGED
@@ -283,17 +283,19 @@ def _parse_object_dict_type(
|
|
283
283
|
|
284
284
|
def _parse_object_extra(cls: Any, text: str, extra: ParseObjectExtra, /) -> Any:
|
285
285
|
try:
|
286
|
-
parser =
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
type_=cls, text=text
|
294
|
-
|
295
|
-
|
296
|
-
|
286
|
+
parser = extra[cls]
|
287
|
+
except KeyError:
|
288
|
+
try:
|
289
|
+
parser = one(
|
290
|
+
p for c, p in extra.items() if (cls is c) or is_subclass_gen(cls, c)
|
291
|
+
)
|
292
|
+
except (OneEmptyError, TypeError):
|
293
|
+
raise _ParseObjectParseError(type_=cls, text=text) from None
|
294
|
+
except OneNonUniqueError as error:
|
295
|
+
raise _ParseObjectExtraNonUniqueError(
|
296
|
+
type_=cls, text=text, first=error.first, second=error.second
|
297
|
+
) from None
|
298
|
+
return parser(text)
|
297
299
|
|
298
300
|
|
299
301
|
def _parse_object_list_type(
|
@@ -600,7 +602,7 @@ class SerializeObjectError(Exception):
|
|
600
602
|
class _SerializeObjectSerializeError(SerializeObjectError):
|
601
603
|
@override
|
602
604
|
def __str__(self) -> str:
|
603
|
-
return f"Unable to serialize object {self.obj!r}"
|
605
|
+
return f"Unable to serialize object {self.obj!r} of type {type(self.obj)!r}"
|
604
606
|
|
605
607
|
|
606
608
|
@dataclass
|
@@ -610,7 +612,7 @@ class _SerializeObjectExtraNonUniqueError(SerializeObjectError):
|
|
610
612
|
|
611
613
|
@override
|
612
614
|
def __str__(self) -> str:
|
613
|
-
return f"Unable to serialize object {self.obj!r} since `extra` must contain exactly one parent class; got {self.first!r}, {self.second!r} and perhaps more"
|
615
|
+
return f"Unable to serialize object {self.obj!r} of type {type(self.obj)!r} since `extra` must contain exactly one parent class; got {self.first!r}, {self.second!r} and perhaps more"
|
614
616
|
|
615
617
|
|
616
618
|
__all__ = ["parse_object", "serialize_object"]
|
utilities/typing.py
CHANGED
@@ -108,7 +108,7 @@ class GetTypeClassesError(Exception):
|
|
108
108
|
class _GetTypeClassesTypeError(GetTypeClassesError):
|
109
109
|
@override
|
110
110
|
def __str__(self) -> str:
|
111
|
-
return f"Object must be a type, tuple or Union type; got {self.obj}"
|
111
|
+
return f"Object must be a type, tuple or Union type; got {self.obj!r} of type {type(self.obj)!r}"
|
112
112
|
|
113
113
|
|
114
114
|
@dataclass(kw_only=True, slots=True)
|
@@ -117,7 +117,7 @@ class _GetTypeClassesTupleError(GetTypeClassesError):
|
|
117
117
|
|
118
118
|
@override
|
119
119
|
def __str__(self) -> str:
|
120
|
-
return f"Tuple must contain types, tuples or Union types only; got {self.inner}"
|
120
|
+
return f"Tuple must contain types, tuples or Union types only; got {self.inner} of type {type(self.inner)!r}"
|
121
121
|
|
122
122
|
|
123
123
|
##
|
@@ -177,7 +177,9 @@ class GetUnionTypeClassesError(Exception):
|
|
177
177
|
class _GetUnionTypeClassesUnionTypeError(GetUnionTypeClassesError):
|
178
178
|
@override
|
179
179
|
def __str__(self) -> str:
|
180
|
-
return
|
180
|
+
return (
|
181
|
+
f"Object must be a Union type; got {self.obj!r} of type {type(self.obj)!r}"
|
182
|
+
)
|
181
183
|
|
182
184
|
|
183
185
|
@dataclass(kw_only=True, slots=True)
|
@@ -186,7 +188,7 @@ class _GetUnionTypeClassesInternalTypeError(GetUnionTypeClassesError):
|
|
186
188
|
|
187
189
|
@override
|
188
190
|
def __str__(self) -> str:
|
189
|
-
return f"Union type must contain types only; got {self.inner}"
|
191
|
+
return f"Union type must contain types only; got {self.inner} of type {type(self.inner)!r}"
|
190
192
|
|
191
193
|
|
192
194
|
##
|
@@ -272,7 +274,7 @@ class IsInstanceGenError(Exception):
|
|
272
274
|
|
273
275
|
@override
|
274
276
|
def __str__(self) -> str:
|
275
|
-
return f"Invalid arguments; got {self.obj!r} and {self.type_!r}"
|
277
|
+
return f"Invalid arguments; got {self.obj!r} of type {type(self.obj)!r} and {self.type_!r} of type {type(self.type_)!r}"
|
276
278
|
|
277
279
|
|
278
280
|
##
|
@@ -432,7 +434,7 @@ class IsSubclassGenError(Exception):
|
|
432
434
|
|
433
435
|
@override
|
434
436
|
def __str__(self) -> str:
|
435
|
-
return f"Argument must be a class; got {self.cls!r}"
|
437
|
+
return f"Argument must be a class; got {self.cls!r} of type {type(self.cls)!r}"
|
436
438
|
|
437
439
|
|
438
440
|
##
|
File without changes
|
File without changes
|