Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions asdf/_asdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -557,6 +557,9 @@ def tree(self, tree):
self._tree = AsdfObject(tree)

def keys(self):
"""
Return view of top-level keys in the tree.
"""
return self.tree.keys()

def __getitem__(self, key):
Expand Down
5 changes: 4 additions & 1 deletion asdf/tags/core/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import collections
import functools

from .constant import Constant
from .external_reference import ExternalArrayReference
Expand All @@ -24,7 +25,9 @@
# to pass an isinstance(..., dict) check and to allow it to be "lazy"
# loaded when "lazy_tree=True".
class AsdfObject(collections.UserDict, dict):
pass
@functools.wraps(collections.UserDict.keys)
def keys(self):
return self.data.keys()


class Software(dict):
Expand Down
Loading