Mailing List Archive

Python grammar test cases
Greetings!

I'm wondering if there's a repository of test cases that
test the Python grammar. Any help would be appreciated.

Thanks & Best Regards,
Venkat.
_______________________________________________
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-leave@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at https://mail.python.org/archives/list/python-dev@python.org/message/RZUBXSU2VVLI42S4WOSIXWYMEL2OYW4D/
Code of Conduct: http://python.org/psf/codeofconduct/
Re: Python grammar test cases [ In reply to ]
10.05.22 08:10, Venkat Ramakrishnan ????:
> I'm wondering if there's a repository of test cases that
> test the Python grammar. Any help would be appreciated.

See test_grammar and test_syntax. And there are some test files for
specific grammar features, like test_string_literals, test_unpack_ex,
test_genexps, test_fstring, etc.

_______________________________________________
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-leave@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at https://mail.python.org/archives/list/python-dev@python.org/message/NW2D3WMQOOFVF5WHJDEG5B4TCIY7UR5U/
Code of Conduct: http://python.org/psf/codeofconduct/
Re: Python grammar test cases [ In reply to ]
Presuming I am looking at the right link?:
https://github.com/python/cpython/tree/main/Lib/test

I am currently focusing on Lambda function. I have a
few test cases written. I have some questions too. Would
be great if I could talk/chat to someone about these
questions.

Thanks.
_______________________________________________
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-leave@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at https://mail.python.org/archives/list/python-dev@python.org/message/LPIBWDUTRQZWQBU4RUEM6GTMA2XQIZMX/
Code of Conduct: http://python.org/psf/codeofconduct/
Re: Python grammar test cases [ In reply to ]
In addition, test_exceptions test a bunch of syntax errors and related
locations.

On Tue, 10 May 2022 at 06:41, Serhiy Storchaka <storchaka@gmail.com> wrote:

> 10.05.22 08:10, Venkat Ramakrishnan ????:
> > I'm wondering if there's a repository of test cases that
> > test the Python grammar. Any help would be appreciated.
>
> See test_grammar and test_syntax. And there are some test files for
> specific grammar features, like test_string_literals, test_unpack_ex,
> test_genexps, test_fstring, etc.
>
> _______________________________________________
> Python-Dev mailing list -- python-dev@python.org
> To unsubscribe send an email to python-dev-leave@python.org
> https://mail.python.org/mailman3/lists/python-dev.python.org/
> Message archived at
> https://mail.python.org/archives/list/python-dev@python.org/message/NW2D3WMQOOFVF5WHJDEG5B4TCIY7UR5U/
> Code of Conduct: http://python.org/psf/codeofconduct/
>
Re: Python grammar test cases [ In reply to ]
Could you share with us some of the context of what are you trying to
achieve? That way we can offer more specialized help :)

On Tue, 10 May 2022 at 15:50, Venkat Ramakrishnan <
venkat.architect@gmail.com> wrote:

> Presuming I am looking at the right link?:
> https://github.com/python/cpython/tree/main/Lib/test
>
> I am currently focusing on Lambda function. I have a
> few test cases written. I have some questions too. Would
> be great if I could talk/chat to someone about these
> questions.
>
> Thanks.
> _______________________________________________
> Python-Dev mailing list -- python-dev@python.org
> To unsubscribe send an email to python-dev-leave@python.org
> https://mail.python.org/mailman3/lists/python-dev.python.org/
> Message archived at
> https://mail.python.org/archives/list/python-dev@python.org/message/LPIBWDUTRQZWQBU4RUEM6GTMA2XQIZMX/
> Code of Conduct: http://python.org/psf/codeofconduct/
>
Re: Python grammar test cases [ In reply to ]
I am looking at:
https://docs.python.org/3/reference/grammar.html

in which the following definition is found:

lambda_slash_no_default:
| lambda_param_no_default+ '/' ','
| lambda_param_no_default+ '/' &':'

Can someone tell me how '/' is being used here in the syntax?

Thanks,
Venkat.
_______________________________________________
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-leave@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at https://mail.python.org/archives/list/python-dev@python.org/message/WNQVENTVABM5VIVUMEPR4WTOV7GMHFXS/
Code of Conduct: http://python.org/psf/codeofconduct/
Re: Python grammar test cases [ In reply to ]
El mar, 10 may 2022 a las 9:06, Venkat Ramakrishnan (<
venkat.architect@gmail.com>) escribió:

> I am looking at:
> https://docs.python.org/3/reference/grammar.html
>
> in which the following definition is found:
>
> lambda_slash_no_default:
> | lambda_param_no_default+ '/' ','
> | lambda_param_no_default+ '/' &':'
>
> Can someone tell me how '/' is being used here in the syntax?
>

It just means the literal / character. It's the marker for positional-only
parameters from PEP 570.


>
> Thanks,
> Venkat.
> _______________________________________________
> Python-Dev mailing list -- python-dev@python.org
> To unsubscribe send an email to python-dev-leave@python.org
> https://mail.python.org/mailman3/lists/python-dev.python.org/
> Message archived at
> https://mail.python.org/archives/list/python-dev@python.org/message/WNQVENTVABM5VIVUMEPR4WTOV7GMHFXS/
> Code of Conduct: http://python.org/psf/codeofconduct/
>
Re: Python grammar test cases [ In reply to ]
That's used as a literal '/' to make positional-only arguments work. For
example:

lambda x, y, /, z: x+y+z

On Tue, 10 May 2022 at 17:11, Venkat Ramakrishnan <
venkat.architect@gmail.com> wrote:

> I am looking at:
> https://docs.python.org/3/reference/grammar.html
>
> in which the following definition is found:
>
> lambda_slash_no_default:
> | lambda_param_no_default+ '/' ','
> | lambda_param_no_default+ '/' &':'
>
> Can someone tell me how '/' is being used here in the syntax?
>
> Thanks,
> Venkat.
> _______________________________________________
> Python-Dev mailing list -- python-dev@python.org
> To unsubscribe send an email to python-dev-leave@python.org
> https://mail.python.org/mailman3/lists/python-dev.python.org/
> Message archived at
> https://mail.python.org/archives/list/python-dev@python.org/message/WNQVENTVABM5VIVUMEPR4WTOV7GMHFXS/
> Code of Conduct: http://python.org/psf/codeofconduct/
>