0

When I'm reading documentation I don't understand what it means when function parameters are in square brackets.

Taking for example OpenCV's GaussianBlur function:

cv2.GaussianBlur(src, ksize, sigmaX[, dst[, sigmaY[, borderType]]]) → dst

What do the square brackets just after sigmaX, mean?

John Kugelman
  • 349,597
  • 67
  • 533
  • 578
Zenocode
  • 656
  • 7
  • 19

1 Answers1

4

It means optional arguments.

It is not python specific syntax, it is more general grammar notation syntax, for example, from https://en.wikipedia.org/wiki/Extended_Backus–Naur_form:

Many BNF specifications found online today are intended to be human-readable and are non-formal. These often include many of the following syntax rules and extensions:

Optional items enclosed in square brackets: [].

Better explanation in https://en.wikipedia.org/wiki/Extended_Backus–Naur_form, Basics chapter.

Community
  • 1
  • 1
Oleksandr
  • 86
  • 3