[Python-ideas] Object interface to path names
aquavitae69 at gmail.com
Thu Sep 15 15:59:24 CEST 2011
On Thu, Sep 15, 2011 at 5:55 AM, Greg Ewing <greg.ewing at canterbury.ac.nz>wrote:
> On 14/09/11 03:03, David Townshend wrote:
> 3. Allow caching of file attribute data so that queries do not have to
>> the disk or network to respond (although at the cost of accuracy).
>> The third can be met be allowing all disk calls to be asynchonous:
> You're mixing up two completely different concepts here. Cacheing has
> nothing to do with asynchronous calls; it's storing the result so that
> you don't have to wait the *next* time you want the information.
I'm not sure if I'm mixing up concepts or terminology. My meaning is, for
example, if a method Path.files() is used to obtain a list of files in a
directory, it would call os.listdir() in another thread and store the result
to a cache. At the same time, the current contents of the cache are returned
by Path.files(). Most of the time, the cache would be written to after its
contents are returned by Path.files(), so the actual value returned would be
inaccurate, but would be more accurate on the next call. To me, this means
caching the result of an asynchronous call to os.listdir(). I suspect,
however, that I'm not using the term "asynchronous" as it normally refers to
disk operations, so that's probably the confusion.
> Both could be useful, but only for certain applications, and they
> should both be off by default in any general-purpose impelentation.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-ideas