Renaming of functions with preservation of backward compatibility

后端 未结 4 1343
轻奢々
轻奢々 2021-02-19 15:12

I refactor my old code and want to change the names of functions in accordance with pep8. But I want to maintain backward compatibility with old parts of system (a complete refa

4条回答
  •  情书的邮戳
    2021-02-19 15:47

    You can bind your function object to another name in your module's namespace, e.g:

    def funcOld(a):
        return a
    
    func_new = funcOld
    

提交回复
热议问题