[Numpy-discussion] Name of the file associated with a memmap

Peter numpy-discussion@maubp.freeserve.co...
Mon Apr 12 16:30:53 CDT 2010


On Mon, Apr 12, 2010 at 10:22 PM, Robert Kern wrote:
>
>Peter wrote:
>>
>> Why is the new property "filename" and not "name" to match
>> the way the Python handle work? e.g.
>>
>>>>> handle = open("Documents/review.pdf")
>>>>> handle.name
>> 'Documents/review.pdf'
>>
>> I concede that "filename" is more explicit, but there is something
>> to be said for consistency as well.
>
> While you would expect the .name attribute of a file object to be a
> file name, the .name attribute an another type of object may be
> something different.

Of course.

> memmap objects are quite different from file
> objects; we gain no particular consistency by using .name instead of
> .filename.

OK - I'm quite happy to accept that ruling, I just want to make
sure someone asked the question.

Thanks,

Peter


More information about the NumPy-Discussion mailing list