@@ -632,7 +632,7 @@ def __bool__(self) -> bool:
632
632
"""
633
633
return bool (self ._options [self ._name ])
634
634
635
- def __call__ (self , * args , ** kwds ):
635
+ def __call__ (self , * args ):
636
636
r"""
637
637
Get or set value of the option ``self``.
638
638
@@ -662,38 +662,20 @@ def __call__(self, *args, **kwds):
662
662
True
663
663
sage: config._reset()
664
664
665
- Check the deprecation ::
665
+ Check the input ::
666
666
667
- sage: config.size(value=None)
668
- doctest:...: DeprecationWarning: keyword argument "value" should be replaced by positional argument
669
- See https://github.com/sagemath/sage/issues/30763 for details.
670
- sage: config.size() is None
671
- True
672
667
sage: config.size(1, 2)
673
668
Traceback (most recent call last):
674
669
...
675
- TypeError: option takes at most one argument "value"
676
- sage: config.size(unknown=3)
677
- Traceback (most recent call last):
678
- ...
679
- TypeError: option takes at most one argument "value"
680
- sage: config.size(4, value=5)
681
- Traceback (most recent call last):
682
- ...
683
- TypeError: option takes at most one argument "value"
670
+ TypeError: option takes at most one argument
684
671
"""
685
- if not args and not kwds :
672
+ if not args :
686
673
return self ._options [self ._name ]
687
- if 'value' in kwds :
688
- from sage .misc .superseded import deprecation
689
- deprecation (30763 , 'keyword argument "value" should be replaced '
690
- 'by positional argument' )
691
- args += (kwds .pop ('value' ),)
692
- if len (args ) > 1 or kwds :
693
- raise TypeError ('option takes at most one argument "value"' )
674
+ if len (args ) > 1 :
675
+ raise TypeError ('option takes at most one argument' )
694
676
self ._options [self ._name ] = args [0 ]
695
677
696
- def __eq__ (self , other ):
678
+ def __eq__ (self , other ) -> bool :
697
679
r"""
698
680
Equality testing for an option in based on the value of the attribute.
699
681
@@ -708,7 +690,7 @@ def __eq__(self, other):
708
690
"""
709
691
return self ._options [self ._name ] == other
710
692
711
- def __ne__ (self , other ):
693
+ def __ne__ (self , other ) -> bool :
712
694
r"""
713
695
Inequality testing for an option in based on the value of
714
696
the attribute.
@@ -724,7 +706,7 @@ def __ne__(self, other):
724
706
"""
725
707
return self ._options [self ._name ] != other
726
708
727
- def __hash__ (self ):
709
+ def __hash__ (self ) -> int :
728
710
r"""
729
711
Return the hash of ``self``, which is the hash of the corresponding
730
712
value.
@@ -736,7 +718,7 @@ def __hash__(self):
736
718
"""
737
719
return hash (self ._options [self ._name ])
738
720
739
- def __str__ (self ):
721
+ def __str__ (self ) -> str :
740
722
r"""
741
723
Return the string representation of ``self``, which is the string of
742
724
the corresponding value.
0 commit comments