I'm using python for a long time. but it was always strange to me why In python references, commands are written like this:
del var1[,var2[,var3[....,varN]]]]
I know that if I want to use the above command I should write it in this way:
del var1, var1
I can't understand the meaning of []
is it related to the lists? any help will be appreciated.
Asked
Active
Viewed 467 times
-3

DSM
- 342,061
- 65
- 592
- 494

hamid kavianathar
- 301
- 2
- 4
- 13
-
The `[,..]` notation usually implies optional arguments – smac89 Dec 08 '15 at 22:31
-
Note that this is also covered [in the docs themselves](https://docs.python.org/2/reference/introduction.html#notation) – jonrsharpe Dec 08 '15 at 22:34
-
thank you all. I haven't read its documents before. I just use it! – hamid kavianathar Dec 08 '15 at 22:42
1 Answers
2
Its just showing that these parameters are optional. This is normal style for references. There is nothing to do with this in python. Just a tutorial explanation.
I bealive, this is taken origin from Usage message

msangel
- 9,895
- 3
- 50
- 69
-
-
-
See https://en.wikipedia.org/wiki/Extended_Backus%E2%80%93Naur_Form – jonrsharpe Dec 08 '15 at 22:37
-
thanks for your attention. I have another question. what is the meaning of dot in this script: from .averager import averager – hamid kavianathar Dec 09 '15 at 08:35