[ACCEPTED]-What do square brackets, "", mean in function/class documentation?-python
The square brackets indicate that these 9 arguments are optional. You can leave them out.
So, in 8 this case you are only required to pass the
csvfile argument 7 to
csv.DictReader. If you would pass a second parameter, it 6 would be interpreted as the
fieldnames arguments. The 5 third would be
If you only want to 4 specify e.g.
dialect, then you'll have to 3 name the keyword argument explicitly, like 2 so:
For more on keyword arguments, see section 4.7.2 of 1 the tutorial at python.org.
Usually in api documentation square brackets 2 mean optional. I would think they mean the 1 same here.
This is actually a subset of the widely 3 used notation to unambiguously describe 2 language syntax called Backus-Naur Form (see Wikipedia article 1 for details).
To reiterate what the others have said, the 8 arguments are optional.
If you leave out 7 optional parts, the remaining
dialect= keywords 6 tell the function which parts are missing.
The 5 syntax doesn't suggest it, but I wouldn't 4 be surprised if the keywords allow the arguments 3 to be specificied in any order, except that 2 the last two arguments must be either both 1 specified, or both omitted.
More Related questions