ESR's fortune.pl redone in python - request for critique

Peter Otten __peter__ at web.de
Thu Apr 1 02:38:20 EST 2004


Adelein and Jeremy wrote:

> (PO)> The operating system and Python may both perform some caching
> as
> (PO)> they see fit, but conceptually (and practically at least for
> (PO)> large files - they can still be larger than your RAM after all)
> (PO)> they are *not* read into memory.
> 
> So ``creating a file object'' is not the best terminology (? -
> because creating other objects puts all of their attributes in a
> defined memory space) - instead, I am creating an object with access
> to a specific file (and of course, with methods to work on that
> file)?

There are other examples for objects not loading their entire data into
memory - e. g. PIL images which you can safely ask for their size without
having to fear that they load each and every pixel, or database tables. The
__getattr__() method and properties further blur the difference between
static data and lazily loaded or calculated data. In short - I think the
term object is appropriate for all of these; the internal representation is
an implementation detail.

Peter




More information about the Python-list mailing list