当参数放在方括号中时,这在文档中是什么意思? [英] What does it mean in documentation when arguments are in square brackets?

查看:69
本文介绍了当参数放在方括号中时,这在文档中是什么意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我阅读文档时,我不明白当函数参数放在方括号中时的含义.

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

以OpenCV的 GaussianBlur 函数为例:

Taking for example OpenCV's GaussianBlur function:

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

sigmaX 之后的方括号是什么意思?

What do the square brackets just after sigmaX, mean?

推荐答案

表示可选参数.

它不是特定于python的语法,而是更通用的语法符号语法,例如,来自

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:

今天在网上找到的许多BNF规范旨在为人类可读,并且是非正式的.这些通常包括以下许多语法规则和扩展名:

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: [].

https://en.wikipedia.org/wiki/中的更好解释Extended_Backus–Naur_form 基础一章.

这篇关于当参数放在方括号中时,这在文档中是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆