Jul-27-2022, 01:40 AM
i have a case where two different functions for different purposes were re-factored in a way that they shared exactly identical code. so i am looking at making them share a single definition:
for those who cannot understand how two different purposes can be handled by exactly the same code, it turns out that a common value somewhere had the proper value in both cases and these functions used that value to carry out their purposes in the new version.
def foo(...arguments...): ...the code... return bar = foothe original two functions had docstrings that explained the different purposes of those two functions. what i would like to know is if there is a way to associate two different docstrings with the two different function names now that they share identical code.
for those who cannot understand how two different purposes can be handled by exactly the same code, it turns out that a common value somewhere had the proper value in both cases and these functions used that value to carry out their purposes in the new version.