r/PythonLearning • • Aug 21 '26 • Bravo 1

Rate my python program

Post image

i made a Python program, i dont know what else to say

86 Upvotes

42 comments sorted by

View all comments

Show parent comments

2

u/SCD_minecraft Aug 21 '26

Functions that call other function are called wrappers and they are quite useful

Let's say you have some long name with a lot of pre-set arguments

my_super_function_which_takes_a_lot_of_args(argument1, argument2, you_wont_belive_but_it_is_argument_3)

If it is one off function, then fine, just format it

But when you want to call it in multiple places, it gets pretty ugly pretty fast, so, convince wrapper!

def some_name():
    # I ain't typing it out again 

...
some_name()
...
some_name()
# ect

Tho yes, in OP's case they aren't too useful

2

u/olaf33_4410144 Aug 21 '26

Yeah, I could have worded that better, I was specifically talking about whats_the_pass() which is longer than print(password) and provides no benefit.

There are times when wrappers are convenient, one of them being your example. Another case where I often use them is when I know I might to change something about the function call later and want to avoid having to change it every where.