[SciPy-user] convert shelved object back to dictionary

Fernando Perez Fernando.Perez at colorado.edu
Thu Oct 6 13:07:22 CDT 2005


Ryan Krauss wrote:
> The weird thing is that I am seeing other __properties__ and methods
> but not __dict__
> 
> In [68]: bd._ <tab>
> bd.__doc__   bd.__file__  bd.__name__  bd.__class__
> 
> but
> In [69]: bd.__dict__
> 
> returns the dictionary Travis was talking about.

Yup, sorry.  That's because tab completion relies on python's builtin dir() 
function, which filters out a few things first, and I have no control over that:

In [1]: class bunch:pass
    ...:

In [2]: a=bunch()

In [3]: a.__dict__
Out[3]: {}

In [4]: dir (a)
Out[4]: ['__doc__', '__module__']

In [5]: a.__
a.__class__   a.__doc__     a.__module__


So this one is out of my control, I'm afraid.

Cheers,

f



More information about the SciPy-user mailing list