I’m having a hard time figuring out the best way to resolve a name clash. Here’s the gist of what I’ve got in front of me:
def clean():
# do some cleaning stuff
def build(clean=True):
if clean:
clean()
Oops.
For a few reasons, I do not want to change the API here. What is the best strategy to resolve this conflict? For now, I’m doing:
def clean():
# do some cleaning stuff
clean_alias = clean
def build(clean=True):
if clean:
clean_alias()
Which might be the best/only solution short of renaming things. I’m just wondering if there’s a different way to reference the clean that’s in the outer scope from within the body of the function?
Try: