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.
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.
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.
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/LPIBWDUT... Code of Conduct: http://python.org/psf/codeofconduct/
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.
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/WNQVENTV... Code of Conduct: http://python.org/psf/codeofconduct/
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/WNQVENTV... Code of Conduct: http://python.org/psf/codeofconduct/
In addition, test_exceptions test a bunch of syntax errors and related
locations.
On Tue, 10 May 2022 at 06:41, Serhiy Storchaka
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/NW2D3WMQ... Code of Conduct: http://python.org/psf/codeofconduct/
participants (4)
-
Jelle Zijlstra
-
Pablo Galindo Salgado
-
Serhiy Storchaka
-
Venkat Ramakrishnan