Re: HttpResponse headers interface

2020-07-16 Thread Carlton Gibson
Hey Tom, The movement of the discussion was (or at least seemed to be, prompting concern) to eventually deprecate and remove, even if on a longer time scale. It’s that that raised the red flags I think. Folks have been stung before: a new feature is introduced with a “May be deprecated in fut

Re: HttpResponse headers interface

2020-07-16 Thread Tom Carrick
But the proposed patch doesn't break any existing code, does it? As far as I can tell, the old interface works the same as it always did. As long as we agree to not deprecate it, which I thought we had, then nothing is breaking. Changing code in other places was at Adam's suggestion, but it's unnec

Re: HttpResponse headers interface

2020-07-16 Thread Carlton Gibson
Hey Nick. > On 16 Jul 2020, at 17:41, Nick Pope wrote: > > I honestly thought the approach Carlton mentioned in > https://github.com/django/django/pull/13186#discussion_r454956921 > struck > the correct balance and we could

Re: HttpResponse headers interface

2020-07-16 Thread Nick Pope
I would agree that `response.headers` *is* by far clearer especially to those not familiar with Django or coming from other frameworks. As Tom says, we only visually know that setting a key on a response object is for headers because of the key name itself, e.g. "Content-Type". I also think tha

Re: HttpResponse headers interface

2020-07-16 Thread Carlton Gibson
The concern is the backwards incompatibility. I do see the reasons for the new approach. I accept that it’s easier to grok if you don’t know Django already — “principal of least astonishment” I think you opened with. I just can’t balance those gains against forcing a change on the entire communit

Re: HttpResponse headers interface

2020-07-16 Thread Tom Carrick
Hmm. I do think that Python's data model is a Good Thing. Where we might disagree is that I don't think this is an appropriate use of it.I'll try to illustrate with an example. Consider this code: response = HttpResponse() response['foo'] = 'bar' Now, if I try to look at this code without context

Re: HttpResponse headers interface

2020-07-16 Thread Carlton Gibson
Some concerns were expressed privately to me privately in the week about the change here. I was thinking about it, and re-reading the API Stability document https://docs.djangoproject.com/en/3.0/misc/api-stability/. The more I look at it, the less convinced I am that the proposal here meets