On Sun, Aug 16, 2020 at 11:18:40AM -0700, Guido van Rossum wrote: > > Just to clarify here, I assume you mean that if xarray cares about > > order-preserving keywords, they should write their methods this way: > > > > def __getitem__(self, index=None, **kwargs): > > > > rather than mandating that keyword args are *always* bundled into a > > single dict parameter. > > > > Um, I'm not sure what "bundled into a single dict parameter" refers to. > > That the signature would be > ``` > def __getitem__(self, index, kwargs, /): > ``` > ? That sounds bad for people who want to use a few choice keywords. (And I > think you'd be against that, for that very reason; as am I.)
Yes, that's exactly it! The analogy is with comma-separated items in the subscript, which get collected (bundled) into a tuple, rather than allocated to multiple parameters. And you are correct that I am against that. If people want that behavious for their class, they can use `**kwargs`. So I think we're on the same page here. -- Steven _______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/JMVVORZHH7MJIYKEIVW3R4SJM3PEM7OM/ Code of Conduct: http://python.org/psf/codeofconduct/