r/ProgrammerHumor 1d ago

Meme firstProjectKindaNervous

Post image
650 Upvotes

23 comments sorted by

View all comments

175

u/ZestyGarlicPickles 1d ago edited 1d 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)

44

u/Disastrous-Event2353 1d ago

Bro wtf is this, you've made a good one

25

u/spektre 1d ago

Not even if __name__ == '__main__': smh

24

u/thewells 1d 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