@@ -395,7 +395,7 @@ def __setattr__(self, name, value):
395
395
"""
396
396
We don't allow user to set attribute.
397
397
"""
398
- if name in dir (self ) and name not in [ "sort" , "extend" ] :
398
+ if name in dir (self ) and name != "sort" :
399
399
raise AttributeError ("'Formula' object attribute '{}' is read-only" .format (name ))
400
400
else :
401
401
raise AttributeError ("'Formula' object has no attribute '{}'" .format (name ))
@@ -408,7 +408,7 @@ def _func(*args, **kwargs):
408
408
return getattr (list , func .__name__ )(* args , ** kwargs )
409
409
return _func
410
410
411
- def _algify_input (func ):
411
+ def _formulaize_input (func ):
412
412
"""Makes last input a Formula object."""
413
413
def _func (* args , ** kwargs ):
414
414
args = list (args [:- 1 ]) + [Formula (args [- 1 ])]
@@ -417,7 +417,7 @@ def _func(*args, **kwargs):
417
417
_func .__name__ = func .__name__ + " "
418
418
return _func
419
419
420
- def _algify_output (func ):
420
+ def _formulaize_output (func ):
421
421
"""Makes output a Formula object."""
422
422
@wraps (getattr (list , func .__name__ .strip ()), assigned = ("__name__" , "__doc__" ))
423
423
def _func (* args , ** kwargs ):
@@ -441,20 +441,21 @@ def _func(*args, **kwargs):
441
441
return args [0 ]
442
442
return _func
443
443
444
- @_algify_output
445
- @_algify_input
444
+ @_formulaize_output
445
+ @_formulaize_input
446
446
def __add__ (self , another ): pass
447
447
if sys .version_info .major == 2 :
448
- @_algify_output
448
+ @_formulaize_output
449
449
def __getslice__ (self , i , j ): pass
450
- @_algify_input
450
+ @_formulaize_input
451
451
def __setslice__ (self , i , j , value ): pass
452
- @_algify_output
452
+ @_formulaize_output
453
453
def __mul__ (self , i ): pass
454
454
def __iadd__ (self , another ):
455
455
return self .__add__ (another )
456
456
457
- @_algify_input
457
+ @_return_self
458
+ @_formulaize_input
458
459
def extend (self , another ): pass
459
460
460
461
def __eq__ (self , another ):
@@ -831,6 +832,6 @@ def mirror(self, direction="LR"):
831
832
self [i ] = self [i ].inverse ()
832
833
return self
833
834
834
- del _stepify , _algify_input , _algify_output , _delattr , _return_self
835
+ del _stepify , _formulaize_input , _formulaize_output , _delattr , _return_self
835
836
836
837
0 commit comments