"Lucas Prado Melo" <[EMAIL PROTECTED]> wrote:

> Hello,
> How could I "prove" to someone that python accepts this syntax using
> the documentation (I couldn't find it anywhere):
> classname.functionname(objectname)


Language reference, mostly section 5.3 Primaries

call ::= 
             primary "(" [argument_list [","]
                            | expression genexpr_for] ")"

primary ::= 
             atom | attributeref
              | subscription | slicing | call

attributeref ::= 
             primary "." identifier

atom ::= 
             identifier | literal | enclosure


That shows fairly well how the classname.functioname bit works (it is an 
attributeref which is a primary which forms the first part of a call), 
but you'll have to wade through a fair bit of the grammar to show that 
argument_list can be an identifier.


argument_list ::= 
             positional_arguments ["," keyword_arguments]
                                     ["," "*" expression]
                                     ["," "**" expression]
                | keyword_arguments ["," "*" expression]
                                    ["," "**" expression]
                | "*" expression ["," "**" expression]
                | "**" expression

positional_arguments ::= 
             expression ("," expression)*

... and so on ...
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to