• JohnnyCanuck@lemmy.ca
    link
    fedilink
    arrow-up
    15
    ·
    2 days ago
    import inspect, builtins
    
    def HelloWorld(funcname):
        caller = inspect.currentframe().f_code.co_name
        getattr(builtins, funcname)(caller)
    
    HelloWorld("print")
    
  • TDCN@feddit.dk
    link
    fedilink
    arrow-up
    10
    ·
    2 days ago

    It took my brain way longer than I want to admit to figure out, what is wrong with that line… I gues my brain just autocorrected it for me without me even knowing.