File tree Expand file tree Collapse file tree 1 file changed +9
-10
lines changed
Expand file tree Collapse file tree 1 file changed +9
-10
lines changed Original file line number Diff line number Diff line change @@ -396,18 +396,17 @@ def __init__(self, func):
396396 else :
397397 #finding argcount for other builtins is a mess
398398 nargs = 2
399- raise warnings .warn (f"""{ func .__name__ } is not supported
400- and may not work as expected""" )
401- if nargs == 2 :
399+ raise warnings .warn (f"{ func .__name__ } is not supported "
400+ "and may not work as expected" )
401+
402+ if nargs == 1 :
403+ self .func = lambda x , pos : func (x )
404+ elif nargs == 2 :
402405 self .func = func
403- elif nargs == 1 :
404- def func_pos (x , pos ):
405- return func (x )
406- self .func = func_pos
407406 else :
408- raise TypeError (f""" Number of parameters in function: { nargs } .
409- FuncFormatter functions take at most 2:
410- x (required), pos (optional)."" " )
407+ raise TypeError (f"Number of parameters in function: { nargs } . "
408+ " FuncFormatter functions take at most 2: "
409+ " x (required), pos (optional)." )
411410
412411 def __call__ (self , x , pos = None ):
413412 """
You can’t perform that action at this time.
0 commit comments