Ian Bicking: the old part of his blog

Comment

I don't usually see people using both __getattr__ and __getitem__ namespaces very effectively -- though the critique holds more for getitem. For instance, on Web-SIG there are some proposals to have things like response['Content-Type'] = 'text/html'. (Not biting anyone's head off, these are just early proposals)

The idea is that we have a namespace of methods, but then we have this __getitem__ namespace on the response just sitting around doing nothing. The problem is backtracking -- seeing the response being used as a dictionary, is there any reason you'd assume it was referring to response headers? This is the case for most __getitem__ implementation, except in very clear mapping structures. It's fine to do response.headers['Content-Type'] = 'text/html', but it's important to contextualize that dictionary access with the headers attribute. At which point, why not allow response.headers.content_type = 'text/html'? Or maybe not...
Comment on So many accessors...
by Ian Bicking