[Python-au] help debugging cacheability.py
mnot at mnot.net
Thu Jul 21 16:30:21 CEST 2005
Ah, lovely - thanks for that. I've been putting off fixing bugs in
cachability.py for a while, as I'm rewriting a lot of the HTTP
underpinnings, but I might do a quick point release just to fix that.
On 20/07/2005, at 6:08 AM, Anthony Baxter wrote:
> On Wednesday 20 July 2005 22:32, Andrew McNamara wrote:
>> def __getattr__(self, attr):
>> if attr == '_':
>> raise AttributeError
>> attr = lower(replace(attr, '_', '-'))
>> return self.data[attr]
> Better yet would be
> def __getattr__(self, attr):
> if attr.startswith('__') and attr.endswith('__'):
> raise AttributeError(attr)
> attr = lower(replace(attr, '_', '-'))
> return self.data[attr]
>> I haven't verified it, but I imagine Python 1.5's hasattr() caught
>> exception and treated it as a missing attribute, rather than
>> catching AttributeError (I seem to remember some discussion of
>> this on
>> python-dev in the mists of time).
> Yep. This bug was a pain in the arse, and I'm glad it's dead.
> Anthony Baxter <anthony at interlink.com.au>
> It's never too late to have a happy childhood.
> python-au maillist - python-au at starship.python.net
Mark Nottingham http://www.mnot.net/
More information about the python-au