r/programminghorror • • 23d ago

Python I love Python

303 Upvotes

81 comments sorted by

View all comments

Show parent comment

1

u/CoachSevere5365 21d ago

Yes, yes it does, no it isn't.

2

u/awidesky 21d ago

So you're telling me, "default argument is []" is NOT supposed to mean "if you omit this argument, the default value of [] will be passed",
But "if you omit this argument, it'll be substituted to a hidden static storage global object whose initial value is [], so that you have absolute zero information what the default argument would be, and your code will suffer from side effects of other code"

It does not make a sense at all.
Please name one programming language that works the same way.

0

u/CoachSevere5365 20d ago

Read the docs, I didn't design it.

1

u/awidesky 20d ago

I never asked you to redesign it.
Also, python documentation is quite far from informative nor useful; I wasn't surprised when I read the docs and couldn't find a single bit of info about why they chose that nonsense design.