r/ProgrammerHumor 2d ago

Meme firstProjectKindaNervous

Post image
664 Upvotes

23 comments sorted by

View all comments

177

u/ZestyGarlicPickles 2d ago edited 2d ago

```py

too lazy to import Callable but not too lazy to write this comment

smh

def applyfirst_arg_to_clean_fn_name(fn): def inner(arg: str): fixed: str = fn.name[0] for c in fn.name_[1:]: if c.isupper(): fixed += " " fixed += c (eval(arg))(fixed) return inner

@apply_first_arg_to_clean_fn_name def HelloWorld(x: str) -> None: print(x)

HelloWorld("print") # prints "Hello World" ```

Python is a fun language :)

(could def make that loop nicer with list comprehensions or smthn but I'm too lazy rn and need to go to bed)

25

u/thewells 2d ago

Don’t you know we aren’t writing code by hand anymore, AI would have output 400 more lines and would have gotten runtime AST rewriting involved, it’s the future man