@@ -41,8 +41,6 @@ from attr import validate as validate
4141from attr import validators as validators
4242from attr import attrib , asdict as asdict , astuple as astuple
4343from attr import NothingType as NothingType
44- from attr import ClassProps as ClassProps
45- from attr import inspect as inspect
4644
4745if sys .version_info >= (3 , 11 ):
4846 from typing import dataclass_transform
@@ -263,3 +261,57 @@ def frozen(
263261 field_transformer : _FieldTransformer | None = ...,
264262 match_args : bool = ...,
265263) -> Callable [[_C ], _C ]: ...
264+
265+ class ClassProps :
266+ """
267+ XXX: somehow defining/using enums Mypy starts looking at our own code
268+ and causes tons of errors.
269+ """
270+
271+ # class Hashability(enum.Enum): ...
272+ # class KeywordOnly(enum.Enum): ...
273+
274+ is_exception : bool
275+ is_slotted : bool
276+ has_weakref_slot : bool
277+ is_frozen : bool
278+ # kw_only: ClassProps.KeywordOnly
279+ kw_only : Any
280+ collected_fields_by_mro : bool
281+ added_init : bool
282+ added_repr : bool
283+ added_eq : bool
284+ added_ordering : bool
285+ # hashability: ClassProps.Hashability
286+ hashability : Any
287+ added_match_args : bool
288+ added_str : bool
289+ added_pickling : bool
290+ on_setattr_hook : _OnSetAttrType | None
291+ field_transformer : Callable [[Attribute [Any ]], Attribute [Any ]] | None
292+
293+ def __init__ (
294+ self ,
295+ is_exception : bool ,
296+ is_slotted : bool ,
297+ has_weakref_slot : bool ,
298+ is_frozen : bool ,
299+ # kw_only: ClassProps.KeywordOnly
300+ kw_only : Any ,
301+ collected_fields_by_mro : bool ,
302+ added_init : bool ,
303+ added_repr : bool ,
304+ added_eq : bool ,
305+ added_ordering : bool ,
306+ # hashability: ClassProps.Hashability
307+ hashability : Any ,
308+ added_match_args : bool ,
309+ added_str : bool ,
310+ added_pickling : bool ,
311+ on_setattr_hook : _OnSetAttrType ,
312+ field_transformer : Callable [[Attribute [Any ]], Attribute [Any ]],
313+ ) -> None : ...
314+ @property
315+ def is_hashable (self ) -> bool : ...
316+
317+ def inspect (cls : type ) -> ClassProps : ...
0 commit comments