On Thu, Aug 20, 2020 at 2:28 PM Jonathan Fine <jfine2...@gmail.com> wrote:
> Hi Todd > > You wrote: > > I think this is a bad idea, since it would mean classes could seem to >> support keyword arguments but silently do the completely wrong thing, >> especially if someone accidentally uses an older version. >> > > I don't see this happening, and certainly don't see it as a new problem. > To help me understand, please provide an example where this happens. > > It would be best to wait a few days first, after I've fixed > https://github.com/jfine2358/python-kwkey/issues/2 > As I said, it could very easily happen in xarray. xarray has a structure called a Dataset, which is a dict-style container for DataArrays (labelled multidimensional arrays). It supports both selecting an array by key or indexing all the arrays by their indices. So imagine a labelled array 'y' with dimensions 'a' and 'b'. So consider this example: ds = Dataset({'y': y}) ds[a=1, b=2] = y[a=2, b=3] If xarray supports keyword arguments, this would assign to the corresponding values. If it didn't, it would create a new element of the Dataset containing "y[a=2, b=3]". But "y" would continue working as it would, only with different values than expected.
_______________________________________________ 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/3CLD2N424UUFF45LBRSUHZKRGW42MPL6/ Code of Conduct: http://python.org/psf/codeofconduct/