# This should be the new dir(), except that it should still list
# the current local name space by default
dictkeys
= x
.__dict
__.keys()
except (AttributeError, TypeError):
except (AttributeError, TypeError):
except (AttributeError, TypeError):
except (AttributeError, TypeError):
except (AttributeError, TypeError):
total
= dictkeys
+ methods
+ members
# It's a class instace; add the class's attributes
# that are functions (methods)...
class_attrs
= listattrs(the_class
)
if is_function(getattr(the_class
, name
)):
class_methods
.append(name
)
total
= total
+ class_methods
# It's a derived class; add the base class attributes
base_attrs
= listattrs(base
)
total
= total
+ base_attrs
if total
[i
] == total
[i
+1]:
# Helper to recognize functions
return type(x
) == type(is_function
)
# Approximation of builtin dir(); but note that this lists the user's
# variables by default, not the current local name space.
return listattrs(__main__
)