@@ -304,6 +304,9 @@ def __init__(self, bins, start, stop, **kwargs):
304
304
The full metadata dictionary
305
305
"""
306
306
307
+ # Inheriting an axis and forgetting to add __slots__ should be an error
308
+ assert not hasattr (self , "__weakref__" ), "Axis subclasses must have __slots__!"
309
+
307
310
with KWArgs (kwargs ) as k :
308
311
metadata = k .optional ("metadata" )
309
312
transform = k .optional ("transform" )
@@ -411,6 +414,10 @@ def __init__(self, edges, **kwargs):
411
414
__dict__: Optional[Dict[str, Any]] = None
412
415
The full metadata dictionary
413
416
"""
417
+
418
+ # Inheriting an axis and forgetting to add __slots__ should be an error
419
+ assert not hasattr (self , "__weakref__" ), "Axis subclasses must have __slots__!"
420
+
414
421
with KWArgs (kwargs ) as k :
415
422
metadata = k .optional ("metadata" )
416
423
__dict__ = k .optional ("__dict__" )
@@ -492,6 +499,10 @@ def __init__(self, start, stop, **kwargs):
492
499
__dict__: Optional[Dict[str, Any]] = None
493
500
The full metadata dictionary
494
501
"""
502
+
503
+ # Inheriting an axis and forgetting to add __slots__ should be an error
504
+ assert not hasattr (self , "__weakref__" ), "Axis subclasses must have __slots__!"
505
+
495
506
with KWArgs (kwargs ) as k :
496
507
metadata = k .optional ("metadata" )
497
508
__dict__ = k .optional ("__dict__" )
@@ -575,6 +586,9 @@ def __init__(self, categories, **kwargs):
575
586
The full metadata dictionary
576
587
"""
577
588
589
+ # Inheriting an axis and forgetting to add __slots__ should be an error
590
+ assert not hasattr (self , "__weakref__" ), "Axis subclasses must have __slots__!"
591
+
578
592
with KWArgs (kwargs ) as k :
579
593
metadata = k .optional ("metadata" )
580
594
__dict__ = k .optional ("__dict__" )
@@ -640,6 +654,10 @@ def __init__(self, categories, **kwargs):
640
654
__dict__: Optional[Dict[str, Any]] = None
641
655
The full metadata dictionary
642
656
"""
657
+
658
+ # Inheriting an axis and forgetting to add __slots__ should be an error
659
+ assert not hasattr (self , "__weakref__" ), "Axis subclasses must have __slots__!"
660
+
643
661
with KWArgs (kwargs ) as k :
644
662
metadata = k .optional ("metadata" )
645
663
__dict__ = k .optional ("__dict__" )
@@ -681,6 +699,10 @@ def __init__(self, **kwargs):
681
699
__dict__: Optional[Dict[str, Any]] = None
682
700
The full metadata dictionary
683
701
"""
702
+
703
+ # Inheriting an axis and forgetting to add __slots__ should be an error
704
+ assert not hasattr (self , "__weakref__" ), "Axis subclasses must have __slots__!"
705
+
684
706
with KWArgs (kwargs ) as k :
685
707
metadata = k .optional ("metadata" )
686
708
__dict__ = k .optional ("__dict__" )
0 commit comments