PEP able? : Request new 'fn' format specifier to specify relationship between positional arguments

Hi, Draft PEP attached: Proposal: def is_between(n1,n2,n3): fn"is number {n1} between {n2} and {n3}" fn"{n2}<{n1}<{n3}?" # the token "fn" immediately following the def statement, speficy the descriptive text # multipe "fn" specifiers describes multiple ways the funtion can be invoked # the "fn" statement is at the same indentation level as the def statement return (n1 > n2 and n1 < n3) . . . # if "fn" statements are found indented and not immediately following def statement, indicate function invocation. # function can be invoked using descriptive text pecified in "fn" statement. if fn"is number {value} between {valid} and {low_threshold}": print("underflow") if is_between(value,low_threshold,high_threshold): print("in range") if fn"{low_threshold}>{value}>{high_threshold} ?" print("overflow") . . Please comment Thanks Shash
participants (1)
-
Shash Srinivasa