Skip to content

Commit

Permalink
Propose a contract for Key.parent.
Browse files Browse the repository at this point in the history
  • Loading branch information
tseaver committed Sep 24, 2014
1 parent a077d7d commit fe1450b
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion gcloud/datastore/key.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ def _clone(self):
We make a shallow copy of the :class:`gcloud.datastore.dataset.Dataset`
because it holds a reference an authenticated connection,
which we don't want to lose.
:rtype: :class:`gcloud.datastore.key.Key`
:returns: a new `Key` instance
"""
clone = copy.deepcopy(self)
clone._dataset = self._dataset # Make a shallow copy of the Dataset.
Expand Down Expand Up @@ -259,7 +262,12 @@ def id_or_name(self):
return self.id() or self.name()

def parent(self):#pragma NO COVER
# See https://github.com/GoogleCloudPlatform/gcloud-python/issues/135
"""Getter: return a new key for the next highest elemen in path.
:rtype: :class:`gcloud.datastore.key.Key`
:returns: a new `Key` instance, whose path consists of all but the last
element of self's path. If self has only one path element, return None.
"""
raise NotImplementedError

def __repr__(self): #pragma NO COVER
Expand Down

0 comments on commit fe1450b

Please sign in to comment.