I was just playing around, and due to a lack of creativity, I couldn't seem to come up with an original idea to code. So I thought of making a module called yep, that uses the name yep
as much as possible. I am not sure why the below class yep
can't be called in main
-- I get an unboundLocal
error. From what I see in my code, all the other yep's
are in their scope, and only the class yep
is global. Which means yep
is defined. When I change the name of yep class
and use that name in main, I don't get an undefined error.
import argparse
class yep:
"""
"""
def __init__(self,yep:str) -> None:
self.yep=yep
def call_yep(self):
"""
makes yep
Args:
param1: yep instance
Returns:
yep
"""
yep=self.yep
return yep
def main(args):
yep=yep(args.yep).yep
return yep
if __name__=='__main__':
parser=argparse.ArgumentParser()
parser.add_argument(
'--yep',default='yep',help='its yep'
)
args=parser.parse_args()
main(args)