If it would be in the __enter__ method, then the ged object could _only_
be used via "with", but that was not my intention ! It is still valid to
create a GED object outside "with" and manually take care to also close
it.

Cheers,
Csaba

On Sa, 2014-03-08 at 16:21 -0800, Bryan Bishop wrote:
> In brlcad/ged.py:
> 
> > +    with GED("file_name.g"):
> > +        ls()
> > +
> > +    This will assure the file is closed at the end, but it's not optimal for interactive use,
> > +    for that you can use:
> > +
> > +    ged_open("file_name.g")
> > +    ls('-l')
> > +    ged_close()
> > +
> > +    Beware that this version will close first whatever other DB was open !
> > +
> > +    """
> > +    def __init__(self, file_name, dbtype=DBType.DB, existing_only=True):
> > +        self.file_name = file_name
> > +        result = libged.ged_open(dbtype, file_name, cta.bool(existing_only))
> 
> Does this ged_open line belong instead in __enter__?
> 
> —
> Reply to this email directly or view it on GitHub.
>