Re: Am I just dreaming, or...

Steven D. Majewski (sdm7g@elvis.med.virginia.edu)
Thu, 4 Aug 1994 11:01:17 -0400

On Aug 4, 10:02, tnb2d@brunelleschi.cs.virginia.edu wrote:
>
> ... did I hear that attributes of an object that begin with an
> underscore ('_') are not supposed to show up when you do a dir() on
> that object? I believe I heard this was coming and it has yet to be
> implemented. Will it be implemented any time soon? And if it is,
> will these attributes show up if I do a vars() on the object?
>

I believe the current case is that objects starting with underscore
are not imported into the current namespace by a "from module import *"
statement, but everything is visible via a dir(module). ( and even
names that are not apparently/obviously visible like obj.__methods__
or something.__members__ or namespaceobj.__dict__ are always reachable/
readable - at least until 'access' get's promoted out of experimental!)

I don't recall a change in this being discussed.
( Did I miss something while I was away? )

It might not be a bad idea, though. Now that we also have 'vars()',
they could be further distinguished by dir() ignoring the private
names. I haven't looked at the code to see if this would be easy to
implement yet.

-- Steve Majewski (804-982-0831) <sdm7g@Virginia.EDU> --
-- UVA Department of Molecular Physiology and Biological Physics --
-- Box 449 Health Science Center Charlottesville,VA 22908 --
[ "Cognitive Science is where Philosophy goes when it dies ...
if it hasn't been good!" - Jerry Fodor ]