dicts and lists will keep working as before. They will not support
keyword arguments (probably ever, as there is no clear semantic for
them) and the current implementation simply throws an error if the
user tries to.

Other classes will take advantage of the syntax for enhanced behavior.
We are not specifying what that specific behavior might be (as in the
case of the @ operator, which is "kind of bound" to a matmul
operation, although it can be used for anything else, like / is used
as a join operator in pathlib, even though its typical meaning is a
division operator). Any class that is willing to accept keyword
arguments for the indexing operation is responsible for documenting
which arguments are accepted and what is the meaning of their use. We
do not prescribe any rule, although some uses can probably be
classified as bad practice.

On Fri, 5 Feb 2021 at 10:30, Larry Hastings <la...@hastings.org> wrote:
>
>
> I missed the discussion around the PEP.  I don't mean to start another one, 
> I'd just like a clarification.  The PEP describes the new functionality, and 
> the interfaces, and that's all fine.  But I didn't see where it discussed 
> where this technology would be used.
>
> Would this mainly be used by third-party math libraries (Pandas, NumPy), like 
> the @ operator, or is there a plan to use this in Python's own library or 
> builtin objects?  If the latter, can you go into the specifics?  I'm guessing 
> the typing module would use it, as illustrated by one of the examples, but 
> beyond that I can't imagine how this would be used by e.g. dicts and lists.
>
>
> Thanks,
>
>
> /arry
>
> On 2/2/21 3:36 AM, Stefano Borini wrote:
>
> Hi all,
>
> I would like to request feedback by python-dev on the current
> implementation of PEP 637 - Support for indexing with keyword
> arguments.
>
> https://www.python.org/dev/peps/pep-0637/
>
> The PEP is ready for SC submission and it has a prototype
> implementation ready, available here (note, not reviewed, but
> apparently fully functional)
>
> https://github.com/python/cpython/compare/master...stefanoborini:PEP-637-implementation-attempt-2
>
> (note: not sure if there's a preference for the link to be to the diff
> or to the branch, let me know if you prefer I change the PEP link)
>
> Thank you for your help.
>
>
> _______________________________________________
> 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/TMAEJYBI7N73L64JPFODOGYD6KQY5PIH/
> Code of Conduct: http://python.org/psf/codeofconduct/



-- 
Kind regards,

Stefano Borini
_______________________________________________
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/LMAYSMML5QEEWROPEL52I43GB2DPWJMZ/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to