@@ -31,7 +31,6 @@ from cysignals.signals cimport sig_check
3131from libc.string cimport memcpy
3232
3333from sage.data_structures.bitset_base cimport *
34- from sage.misc.superseded import deprecated_function_alias
3534from sage.rings.finite_rings.finite_field_base import FiniteField
3635from sage.rings.finite_rings.finite_field_constructor import GF
3736from sage.rings.integer cimport Integer
@@ -351,7 +350,7 @@ cdef class BooleanFunction(SageObject):
351350 def __dealloc__ (self ):
352351 bitset_free(self ._truth_table)
353352
354- def _repr_ (self ):
353+ def _repr_ (self ) -> str :
355354 """
356355 EXAMPLES::
357356
@@ -612,7 +611,7 @@ cdef class BooleanFunction(SageObject):
612611 """
613612 return 2 ** self ._nvariables
614613
615- def __richcmp__ (BooleanFunction self , other , int op ):
614+ def __richcmp__ (BooleanFunction self , other , int op ) -> bool :
616615 """
617616 Boolean functions are considered to be equal if the number of
618617 input variables is the same , and all the values are equal.
@@ -745,15 +744,16 @@ cdef class BooleanFunction(SageObject):
745744 {8: 64}
746745 """
747746 d = {}
748- cdef long i
747+ cdef long i, a
749748 for i in self .walsh_hadamard_transform():
750- if abs (i) in d:
751- d[abs (i)] += 1
749+ a = abs (i)
750+ if a in d:
751+ d[a] += 1
752752 else :
753- d[abs (i) ] = 1
753+ d[a ] = 1
754754 return d
755755
756- def is_balanced (self ):
756+ def is_balanced (self ) -> bool :
757757 """
758758 Return ``True`` if the function takes the value ``True`` half of the time.
759759
@@ -769,7 +769,7 @@ cdef class BooleanFunction(SageObject):
769769 """
770770 return self.walsh_hadamard_transform()[0] == 0
771771
772- def is_symmetric (self ):
772+ def is_symmetric(self ) -> bool :
773773 """
774774 Return ``True`` if the function is symmetric , i.e. invariant under
775775 permutation of its input bits.
@@ -821,7 +821,7 @@ cdef class BooleanFunction(SageObject):
821821 ((1<<self._nvariables) - max(abs(w) for w in self.walsh_hadamard_transform())) >> 1
822822 return self._nonlinearity
823823
824- def is_bent (self ):
824+ def is_bent(self) -> bool :
825825 """
826826 Return ``True `` if the function is bent.
827827
@@ -928,12 +928,13 @@ cdef class BooleanFunction(SageObject):
928928 [(0 , 33 ), (8 , 58 ), (16 , 28 ), (24 , 6 ), (32 , 2 ), (128 , 1 )]
929929 """
930930 d = {}
931- cdef long i
931+ cdef long i, a
932932 for i in self.autocorrelation():
933- if abs (i) in d:
934- d[abs (i)] += 1
933+ a = abs(i)
934+ if a in d:
935+ d[a] += 1
935936 else:
936- d[abs (i) ] = 1
937+ d[a ] = 1
937938 return d
938939
939940 def absolute_indicator(self):
@@ -949,24 +950,13 @@ cdef class BooleanFunction(SageObject):
949950 sage: B = BooleanFunction(" 7969817CC5893BA6AC326E47619F5AD0" )
950951 sage: B.absolute_indicator()
951952 32
952-
953- The old method's name contained a typo, it is deprecated::
954-
955- sage: B.absolut_indicator()
956- doctest:warning
957- ...
958- DeprecationWarning: absolut_indicator is deprecated. Please use absolute_indicator instead.
959- See https://github.com/sagemath/sage/issues/28001 for details.
960- 32
961953 """
962954 cdef long a
963955 if self._absolute_indicator is None:
964956 D = self.autocorrelation()
965957 self._absolute_indicator = max([abs(a) for a in D[1:]])
966958 return self._absolute_indicator
967959
968- absolut_indicator = deprecated_function_alias(28001 , absolute_indicator)
969-
970960 def sum_of_square_indicator(self):
971961 """
972962 Return the sum of square indicator of the function.
0 commit comments