On Jan 30, 2009, at 17:28, Todd O'Bryan wrote: > OK, after I did this, I was lying in bed and had the following > revelation. Would there be anything terribly wrong with just using > __getattr__ in UploadedFile to forward all attribute requests that the > UploadedFile can't process to self._file, the file-like object that > would be backing it? That way, you get access to all the features of > the underlying file without much overhead in the UploadedFile. > > Thoughts?
asyncore from Python's standard library does that. It's not a great idea at all. For many reasons, one being the principle of least astonishment. Much rather, copy the attributes. But then you start going the winding path down to "I'm merging this instance into myself", and you end up with messy code. Anyway, the file-like methods are a finite set. Why not try to be complete? (This issue has bitten me by the way, and I did f.readline = f._file.readline.) - Ludvig --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-developers@googlegroups.com To unsubscribe from this group, send email to django-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-developers?hl=en -~----------~----~----~----~------~----~------~--~---