[Python-Dev] Re: PEP 505 (None-aware operators) for Python 3.11
I tried to implement this in CPython by modifying a downloaded source code, but I can't seem to fix the problem of the "maybe" operators segfaulting when being used with literal immutables. The maybe-assign/coalesce operators were implemented successfully though. ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@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/2TGUBJFMNKTCG4IIOE444CYIUT4GZBDI/ Code of Conduct: http://python.org/psf/codeofconduct/
[Python-Dev] Re: Naming convention for AST types
This is the convention according to my expertise: > PascalCase: subtype of a token type, cannot be used in a `rule_name[type]:` > definition in grammar > lower_snake_case: a token type PascalCase nodes are those used in the functions `_PyAST_*` (or one of the expression contexts), while lower_snake_case nodes are used in the `*_ty` ones. For example, the `arg` node: > kwds[arg_ty]: '**' a=param_no_default { a } And the `FunctionDef` node: > | 'def' n=NAME '(' params=[params] ')' a=['->' z=expression { z }] &&':' > tc=[func_type_comment] b=block { > _PyAST_FunctionDef(n->v.Name.id, > (params) ? params : CHECK(arguments_ty, > _PyPegen_empty_arguments(p)), > b, NULL, a, NEW_TYPE_COMMENT(p, tc), EXTRA) } ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@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/XSERXCF7LJ6IEYBD54ATEP2VROLSUI4Q/ Code of Conduct: http://python.org/psf/codeofconduct/
[Python-Dev] Re: Naming convention for AST types
Here's a short description: > PascalCase: used in `_PyAST_*` nodes > lower_snake_case: used in `*_ty` nodes ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@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/AA5VWQA3GXSFHGJOUNAZ3YFMM6YKNRXA/ Code of Conduct: http://python.org/psf/codeofconduct/
[Python-Dev] Re: Naming convention for AST types
Sorry for the two replies, I didn't think the first one would be sent. ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@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/DNZMANF45N6WGGWYYN5JIQ67IDTCIL4Q/ Code of Conduct: http://python.org/psf/codeofconduct/
[Python-Dev] Optimizing literal comparisons and contains
Many operations involving two literals are optimized (to a certain level). So it sort of surprises me that literal comparisons are not optimized and literal contains only convert the right operand to a constant if possible. I'd like to implement optimizations for these especially for the literal contains. There is a TODO in the ast optimizer for literal comparisons as well, and that's another reason I would like to have these added. ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@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/5I2GXLMVZ6OOLACL2BB2ER4L2RKEGWIJ/ Code of Conduct: http://python.org/psf/codeofconduct/
[Python-Dev] Re: Optimizing literal comparisons and contains
The code in the pull request is not updated and cannot be updated (though I seem to have fixed the bugs in the test in my modified CPython build). It won't merge, and I definitely believe it won't pass. ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@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/VZSDFTCYQUQUMF37FR4W6XI3C372GHCB/ Code of Conduct: http://python.org/psf/codeofconduct/
[Python-Dev] Re: Require a C compiler supporting C99 to build Python 3.11
On Mon, Feb 7, 2022 at 5:11 PM Victor Stinner vstin...@python.org wrote: > I made a change to require C99 "NAN" constant and I'm was > asked to update the PEP 7 to clarify the C subset is needed to build > Python 3.11. What if it was built with MSVC which is usually just C90? ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@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/JSQX3OY4XMTBLLCERP3JDJXPPT2BMQQ6/ Code of Conduct: http://python.org/psf/codeofconduct/
[Python-Dev] Re: An unambiguous way of initializing an empty dictionary and set
> s = {} # new empty set > d = {:} # new empty dictionary (the ":" is a reference to key-value pairs) Even though this isn't python-ideas, I just want to suggest having it like this: s = {,} # new empty set d = {} # same syntax for new empty dictionary Instead of the backwards-incompatible change above. ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@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/KHN7GOKSUXA22ZZK7Y67UPM6QYOVDLAQ/ Code of Conduct: http://python.org/psf/codeofconduct/
[Python-Dev] Re: [RELEASE] The last Python 3.11 alpha (3.11.0a7) is available - Prepare for beta freeze
> Among the new major new features and changes so far: This section of major new features should've included the addition of atomic groups/possessive matching into the `re` module. This is a boost in regex matching performance when the pattern doesn't need any backtracking. ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@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/RQLG4LHKRALHERZKARFXUDTYCRBFV6ST/ Code of Conduct: http://python.org/psf/codeofconduct/
[Python-Dev] Re: [RELEASE] The last Python 3.11 alpha (3.11.0a7) is available - Prepare for beta freeze
> Can you provide a bpo number, please? bpo-433030 ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@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/M46P53HIT54YIJWJGE65P6CSWOBNDVYB/ Code of Conduct: http://python.org/psf/codeofconduct/