[Python-Dev] Arbitrary non-identifier string keys when using **kwargs

Steven D'Aprano steve at pearwood.info
Tue Oct 9 19:06:05 EDT 2018


On Tue, Oct 09, 2018 at 09:37:48AM -0700, Jeff Hardy wrote:

> > When this behavior of set/getattr was discussed a decade or so ago,
> > Guido said not to disable it, but I believe he said it should not be
> > considered a language feature.  There are other situations where CPython
> > is 'looser' than the spec.
> 
> From an alternative implementation point of view, CPython's behaviour
> *is* the spec. Practicality beats purity and all that.

Are you speaking on behalf of all authors of alternate implementations, 
or even of some of them?

It certainly is not true that CPython's behaviour "is" the spec. PyPy 
keeps a list of CPython behaviour they don't match, either because they 
choose not to for other reasons, or because they believe that the 
CPython behaviour is buggy. I daresay IronPython and Jython have 
similar.

And this especially applies when CPython explicitly states that certain 
behaviour is implementation-dependent and could change in the future.


-- 
Steve


More information about the Python-Dev mailing list