"Guido van Rossum" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
| In Py3k, dir() will allow any class to makes its instances special
| cases by defining __dir__().
Nice. Then the current special case will become explainable as
type.__dir__ excluding type's numerous attibutes, to
On Sat, Mar 15, 2008 at 1:11 PM, Nick Coghlan <[EMAIL PROTECTED]> wrote:
> Guido van Rossum wrote:
> > This is because dir() special-cases classes, isn't it?
>
> Avoiding infinite recursion in dir(type) might be fun if that special
> case was removed without due care and attention...
I wasn't s
Guido van Rossum wrote:
> This is because dir() special-cases classes, isn't it?
Avoiding infinite recursion in dir(type) might be fun if that special
case was removed without due care and attention...
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
This is because dir() special-cases classes, isn't it?
On Sat, Mar 15, 2008 at 11:09 AM, Christian Heimes <[EMAIL PROTECTED]> wrote:
> > Why __bases__ does not appear in dir()?
> >
> > Is there a good reason for this or should I file a bug?
>
> __bases__ and several other methods like mro and _
> Why __bases__ does not appear in dir()?
>
> Is there a good reason for this or should I file a bug?
__bases__ and several other methods like mro and __subclasses__ are
defined on the meta class. dir() doesn't list the attributes of the meta
class of a class.
>>> class C(object):
... pass