class foo(object):
    __slots__ = ['__base__']

What's expected is for foo.__base__ to be a member_descriptor object
but instead what you get is:

>>> foo.__base__
<class 'object'>
>>> foo.__base__ is object
True

I guess something happens within the magic of class construction that makes use of __base__ as an object.

I stumbled across this because my particular class represented by foo makes use of __base__ for holding objects foo makes special instances of when called.

Just something interesting to note here, and possibly some useful knowledge so others can know to stay away from '__base__' as a class attr name.

All you are doing is setting a hidden propertyt to a list of one string. The fact that the string has the value 'base' is of no consequence. Set it to some other value and you will get the same result for foo.__base__.

actually, setting it to another value got things working, in my case foo.__held__ returns a member_descriptor as expected:

class foo(object):
    __slots__ = ['__held__']

as the result:

>>> foo.__held__
<member '__held__' of 'foo' objects>

another one that returns object is foo.__object__.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.