how to read a syntax diagram

Steven D'Aprano steve+comp.lang.python at pearwood.info
Sun May 27 19:24:57 EDT 2018


On Sun, 27 May 2018 21:17:57 +0000, Paul wrote:

> hi,
>    I'm using the Google Sheets API (the client library rather than the
> RESTful interface) and I'm confused about the meaning of the syntax
> diagrams.

*Diagrams*? As in, *pictures*?


> update(spreadsheetId=*, range=*, body=*, valueInputOption=None,
> x__xgafv=None, responseValueRenderOption=None,
> includeValuesInResponse=None, responseDateTimeRenderOption=None)
[...]

> My specific questions are:
>    1) is this standard (python?) syntax notation?  I haven't found a key
>    to this form of documentation.

No.

>    1)  What does  '=*' mean?

No idea.

>    2)  What does '=None' mean?    [my guess is that this means "no
>    default value"].

If they are using the same meaning as the standard convention in Python, 
it means the opposite: that None is the default.

If they mean something else, your guess is as good as mine.


>    3)  Note that it says that range is required.  Through trial, I see
>    that
> *one* of the 'range' specifications is required.  I.E., I can specify
> 'range' outside body, or 'range' as part of body, or both, but I must
> have 'range' someplace.   This is a bit confusing to me ( as opposed to
> my usual understanding of "required").  Also, what does range mean, in
> these two different spots, and what does it mean if two different values
> of range are specified?

No idea.


-- 
Steven D'Aprano
"Ever since I learned about confirmation bias, I've been seeing
it everywhere." -- Jon Ronson




More information about the Python-list mailing list