From 3546f3bdaab45db73e20d0be42334fd2e12b6c12 Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Sat, 25 Jun 2022 20:45:16 -0500 Subject: [PATCH] Fix type annotation of Record-ish.__slots__; it's a ClassVar --- pytools/__init__.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pytools/__init__.py b/pytools/__init__.py index c2ced5f..581eabf 100644 --- a/pytools/__init__.py +++ b/pytools/__init__.py @@ -34,7 +34,7 @@ import sys import logging from typing import ( Any, Callable, Dict, Generic, Hashable, Iterable, - List, Optional, Set, Tuple, TypeVar, Union) + List, Optional, Set, Tuple, TypeVar, Union, ClassVar) import builtins import math @@ -394,7 +394,8 @@ class RecordWithoutPickling: will be individually derived from this class. """ - __slots__: List[str] = [] + __slots__: ClassVar[List[str]] = [] + fields: ClassVar[Set[str]] def __init__(self, valuedict=None, exclude=None, **kwargs): assert self.__class__ is not Record @@ -451,7 +452,7 @@ class RecordWithoutPickling: class Record(RecordWithoutPickling): - __slots__: List[str] = [] + __slots__: ClassVar[List[str]] = [] def __getstate__(self): return { -- GitLab