[Python-Dev] Re: Capabilities - published interfaces

Michael Hudson mwh at python.net
Mon Dec 22 14:56:32 EST 2003


"Terry Reedy" <tjreedy at udel.edu> writes:

> "Luke Kenneth Casson Leighton" <lkcl at lkcl.net>
> wrote in message
> news:20031220121942.GF1933 at lkcl.net...
>> if you "feed" access to __class__ via a single
> function, you have
>> a bottleneck again which can be replaced.
>>
>> so, the proposal is simple: create an
> __builtin__ function called
>> __get_class__ through which access to __class__
> is made.
>>
>
> I wonder if it would not be better to turn
> __class__ into a property with a get function that
> conditionally gives out the real thing.

As much as it makes sense to say it, __class__ is a property -- really
a getset descriptor, but that's just because it's in C.

It would be a imple matter to add a call to PyEval_GetRestricted in
object_get_class (not sure whether this is wise or helpful -- only
been skimming this thread -- but it certainly ain't hard).

Cheers,
mwh

-- 
  I don't remember any dirty green trousers.
                                             -- Ian Jackson, ucam.chat



More information about the Python-Dev mailing list