55from inspect import isclass
66from pprint import pformat
77from textwrap import dedent , wrap
8- from typing import Any , Callable , Generic , Self , Type , TypeVar , overload
8+ from typing import Any , Callable , Self , Type , TypeVar , overload
99
1010import numpy as np
1111from astropy .units import Quantity , Unit , UnitBase , UnitConversionError
@@ -24,12 +24,11 @@ class FieldValidationError(ValueError):
2424 pass
2525
2626
27- T = TypeVar ("T" )
2827T1 = TypeVar ("T1" )
2928T2 = TypeVar ("T2" )
3029
3130
32- class Field ( Generic [T ]) :
31+ class Field [T ]:
3332 """
3433 Class for storing data in a `Container`.
3534
@@ -178,11 +177,11 @@ def __init__(
178177 # we only specify the Descriptor protocol __get__ here has it helps type checkers
179178 # and IDEs to provide insights on types of container fields. It is not actually used at runtime
180179 # since the ContainerMeta turns Fields into __slots__ based access to member variables.
181- # 2 . When accessed via the class (e.g., MyContainer.foo), only owner present
180+ # 1 . When accessed via the class (e.g., MyContainer.foo), only owner present
182181 @overload
183182 def __get__ (self , instance : None , owner : Any ) -> Self : ...
184183
185- # 1 . access via instance, both arguments present
184+ # 2 . access via instance, both arguments present
186185 @overload
187186 def __get__ (self , instance : "Container" , owner : "Type[Container]" ) -> T : ...
188187
@@ -567,11 +566,7 @@ def validate(self):
567566 )
568567
569568
570- K = TypeVar ("K" )
571- V = TypeVar ("V" )
572-
573-
574- class Map (defaultdict [K , V ]):
569+ class Map [K , V ](defaultdict [K , V ]):
575570 """A dictionary of sub-containers that can be added to a Container. This
576571 may be used e.g. to store a set of identical sub-Containers (e.g. indexed
577572 by ``tel_id`` or algorithm name).
0 commit comments