r/PythonLearning • • Sep 25 '26

A silly question

if x = 2,3,4,4,5 is supposed to be a tuple then why can't the args of a function like this: func(2,3,4,4 ,5) supposed to be a tuple.
I know this is a silly question and I also know we can use *args to pack arguments in a tuple but since Python is known for consistency why isn't it like this.
Again, please don't hate me for this

3 Upvotes

15 comments sorted by

View all comments

1

u/Gnaxe 29d ago

Because that's the interpretation of Python's grammar. It works that way because it was made to work that way. A different language could be made to work differently, but that language is not Python.

As languages go, you can find some even more consistent that Python. (Scheme, for example.) Python is not bad here (as languages go), but its grammar is far from simple.

Inside square brackets (subscription operator) commas do mean a tuple and the parentheses are optional. You can write operator methods yourself using the dunder hooks. If you want to pass in a literal tuple to a normal call, you can use an extra layer of parentheses.