On Wed, Jan 25, 2006 at 10:24:51PM +0000, Alberto Simões wrote: > Chip: > >The above-quoted example is only plausible if it's shorthand for, e.g.: > > > > $P1 = $P0.stat # or lstat > > $P1.is_dir() > > $P1.is_file() > > > > Looking to this code, $P0.stat should return a Stat PMC object, so we > can call is_dir and is_file. > Other option is to specify that 'is_dir' and 'is_file' stat the file > everytime they are called.
(Call this paragraph "A") I wouldn't call this 'another option'. Your two proposals in paragraph "A" are compatible with each other. > For me, both options are reasonable. Chip's proposal have the advantage > of caching the info. Oh dear, I goofed in my example. What I meant is actually compatible with what you write in paragraph "A" above, namely, that: $P0.stat works, and $P0.is_dir $P0.is_file is shorthand for $P1 = $P0.stat $P1.is_dir() $P1 = $P0.stat # NOTE IMPORTANT SECOND CALL THAT I FORGOT LAST TIME, GRRR $P1.is_file() -- Chip Salzenberg <[EMAIL PROTECTED]>